Kodi Community Forum
[RELEASE] Launcher - application launcher plugin for Linux, Mac, Windows, and Xbox - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] Launcher - application launcher plugin for Linux, Mac, Windows, and Xbox (/showthread.php?tid=35739)



- zosky - 2009-10-31

simphax Wrote:Hi! Just wanted to share my solution to the fullscreen problem on Windows machines. If you have the problem that XBMC cannot minimize when in fullscreen and therefore you cannot use the launched application because xbmc is covering the screen, please follow these instructions:

Many thanks for this tip. + the steps are not much different for xbmcLive / ubuntu / linux...
  1. EDIT ~/.xbmc/plugins/programs/Launcher/resources/lib/launcher_plugin.py
  2. FIND TWO elif (sys.platform.startswith('linux')):
  3. WRAP BOTH with xbmc.executehttpapi("Action(199)")...ex1...
    Code:
    elif (sys.platform.startswith('linux')):
    [color=Red]                        xbmc.executehttpapi("Action(199)")[/color]
                            os.system("\"%s\" %s \"%s\"" % (launcher["application"], launcher["args"], rom["filename"]))
    [color=Red]                        xbmc.executehttpapi("Action(199)")
    [/color]
  4. Bingo Bango

EDIT: i originally did this by creating a BASH script (like a BAT file in windows)
EDIT 2 > now i've moved action(199) to the launcher_plugin.py, thanks simphax.
EDIT 3 > Still need BASH-fu Wink to HIDE the control from XBMC when playing games ...
(otherwise event server continues passing command to xbmc [without focus] while launcher is running emu's)
  1. delete /userdata/keymap/logtitech.xml
  2. refresh keymaping ... Action(203)
  3. launch
  4. restore keymap
  5. refresh key list ... Action(203)

Code:
[color=DarkOrange]  rm /home/xbmc/.xbmc/userdata/keymaps/LogitechRumble.xml # remove keymap[/color]
    [color=Red]curl "http://localhost:8080/xbmcCmds/xbmcHttp?command=Action(203)" # reload Keys[/color]
    $@
[color=DarkOrange]    cp /home/xbmc/.xbmc/userdata/keymaps/LogitechRumble.xml~ \
       /home/xbmc/.xbmc/userdata/keymaps/LogitechRumble.xml     # restore keys[/color]
[color=Red]    curl "http://localhost:8080/xbmcCmds/xbmcHttp?command=Action(203)" # relaod keys
[/color]

in the userdata/plugin_data/programs/Launcher/launchers.xml

  1. point each <launcher> <application> @ your scipt (BAT or SH)
  2. point ARG1 to your EMU/APP
  3. put [arg1] [arg2] [arg3] as [2,3,4]...

Code:
    <launcher>
        <name>nes</name>
        <application>[b]/path/to/the/scipt[/b]</application>
        <args>mednafen -nes.stretch 1 -nes.input.port1 gamepad  -nes.special scale4x -nes.pixshader scale4x -vdriver sdl -fs 1 -nes.xres 1920 -nes.yres 1080 </args>
        <rompath>/home/xbmc/links/gameISOs/NES/</rompath>
        <romext>nes</romext>

Is it possible to do this in the launcher_plugin.py ?


Firefox without focus - fmaesso - 2009-11-08

Hi!
Here, I press the key '\' and the screen go to the 1/4 of normal size, but the keyboard and mouse set focus on the firefox. When I quit of firefox, I press \ again and the screen size come back to the normal size.

This is a stupid solution, but a solution.

Sorry for my bad english!

Fernando Maesso


- desperz - 2009-11-12

Hi,

When i try that simphax say about copy that line in to the launcher_plugin.py
i'll get som error when try to open launcher.

http://pastebin.com/m5509da2c


- leo2 - 2009-11-12

desperz Wrote:Hi,

When i try that simphax say about copy that line in to the launcher_plugin.py
i'll get som error when try to open launcher.

http://pastebin.com/m5509da2c

try to modify the line directly without copy-paste, you might have copied a tab or spaces that are not in the correct place.
python language is very strict about spaces and tabs.


- desperz - 2009-11-13

Now i get no error but xbmc is still in foreground any clue

http://pastebin.com/d42102e23


- desperz - 2009-11-13

It's working Smile
When i delete xbmc in roaming and start all over it work.
Thanks

/TT


- arosequi - 2009-11-14

zosky Wrote:Many thanks for this tip. + the steps are not much different for xbmcLive / ubuntu / linux...
  1. EDIT ~/.xbmc/plugins/programs/Launcher/resources/lib/launcher_plugin.py
  2. FIND TWO elif (sys.platform.startswith('linux')):
  3. WRAP BOTH with xbmc.executehttpapi("Action(199)")...ex1...
    Code:
    elif (sys.platform.startswith('linux')):
    [color=Red]                        xbmc.executehttpapi("Action(199)")[/color]
                            os.system("\"%s\" %s \"%s\"" % (launcher["application"], launcher["args"], rom["filename"]))
    [color=Red]                        xbmc.executehttpapi("Action(199)")
    [/color]
  4. Bingo Bango

EDIT: i originally did this by creating a BASH script (like a BAT file in windows)
EDIT 2 > now i've moved action(199) to the launcher_plugin.py, thanks simphax.
EDIT 3 > Still need BASH-fu Wink to HIDE the control from XBMC when playing games ...
(otherwise event server continues passing command to xbmc [without focus] while launcher is running emu's)
  1. delete /userdata/keymap/logtitech.xml
  2. refresh keymaping ... Action(203)
  3. launch
  4. restore keymap
  5. refresh key list ... Action(203)

Code:
[color=DarkOrange]  rm /home/xbmc/.xbmc/userdata/keymaps/LogitechRumble.xml # remove keymap[/color]
    [color=Red]curl "http://localhost:8080/xbmcCmds/xbmcHttp?command=Action(203)" # reload Keys[/color]
    $@
[color=DarkOrange]    cp /home/xbmc/.xbmc/userdata/keymaps/LogitechRumble.xml~ \
       /home/xbmc/.xbmc/userdata/keymaps/LogitechRumble.xml     # restore keys[/color]
[color=Red]    curl "http://localhost:8080/xbmcCmds/xbmcHttp?command=Action(203)" # relaod keys
[/color]

in the userdata/plugin_data/programs/Launcher/launchers.xml

  1. point each <launcher> <application> @ your scipt (BAT or SH)
  2. point ARG1 to your EMU/APP
  3. put [arg1] [arg2] [arg3] as [2,3,4]...

Code:
    <launcher>
        <name>nes</name>
        <application>[b]/path/to/the/scipt[/b]</application>
        <args>mednafen -nes.stretch 1 -nes.input.port1 gamepad  -nes.special scale4x -nes.pixshader scale4x -vdriver sdl -fs 1 -nes.xres 1920 -nes.yres 1080 </args>
        <rompath>/home/xbmc/links/gameISOs/NES/</rompath>
        <romext>nes</romext>

Is it possible to do this in the launcher_plugin.py ?

Did you have to do anything to get Launcher working in Linux? It won't even load up for me. Kinda sucks that development has stopped on it -- having a good method of playing games would be great to have in XBMC.


- leo2 - 2009-11-14

Launcher works on linux without any change, just download the latest version and unzip it into programs plugins directory. (see first post for details)


- JustSomeUser - 2009-11-17

Quote:I've found a method of launching from directories that contain spaces that works for me. Using latest build on XP.

I created a Shortcuts dir at the root of my drive containing a .bat file for each app that I want a launcher for.

To launch firefox I point Launcher at the following file:

D:\Shortcuts\firefox.bat

The contents of which are:

cd d:\program files\mozilla firefox\
start firefox.exe

Seems to work okay, I haven't tried any other apps/games or emulators yet though.

The problems with spaces seems related to this http://trac.xbmc.org/ticket/7337

To fix it just open "XBMC\plugins\Programs\Launcher\resources\lib\launcher_plugin.py"

search for "def _run_launcher(self, launcherName)"
look for "xbmc.executebuiltin" and escape the quotes like this
Code:
xbmc.executebuiltin("%s(\\\"%s\\\" \\\"%s\\\")" % (cmd, launcher["application"], launcher["args"]))

repeat this for "def _run_rom(self, launcherName, romName)" (few lines below)
and save the file
now delete "XBMC\plugins\Programs\Launcher\resources\lib\launcher_plugin.pyo" and try it out.

Tested with Launcher 1.04 and XBMC 9.11-a2 on WinXP64


- fidoboy - 2009-11-18

Hi all, i want to report here that this plugin is not working fine with latest alpha2 release on Linux. Until now i've been using the plugin with no problems but after the alpha2 update, when i launch firefox (or other apps) from XBMC live the app launches but i can't get it on focus, so i am unable to use the mouse or keyboard to perform any action on the app...

regards,


- fablog - 2009-11-19

What a frustration...

This is a super plugin but now it's not working for lack of support/integration in XBMC. For my system it's a master piece and now I must use the xbmc stable version to get this plugin working because with the last SVN it's not!!
I hope some will work on it.
JustSomeUser, thanks for your help, but it doesn't work for the ver. 24114.


- JustSomeUser - 2009-11-19

@fablog
You should try the alpha "XBMC 9.11-a2" it has rev24542 which is newer than your SVN 24114, as mentioned in my last post it's working with it.



Now about that sorting problem,
to get launcher to sort the roms and launchers alphabetically and not randomly.


To fix it just open "XBMC\plugins\Programs\Launcher\resources\lib\laun cher_plugin.py"

search for
PHP Code:
def _get_romsselflauncherName ):
...
            if (
len(roms) > 0) :
                for 
index in roms :
                    
rom roms[index]
                    
self._add_rom(launcherNamerom["name"], rom["filename"], rom["thumb"], len(roms))
            else:
... 
change to
PHP Code:
def _get_romsselflauncherName ):
...
            if (
len(roms) > 0) :
                for 
key in sorted(roms.iterkeys()):
                    
self._add_rom(launcherNameroms[key]["name"], roms[key]["filename"], roms[key]["thumb"], len(roms))
            else:
... 

search for
PHP Code:
def _get_launchersself ):
...
        if (
len(self.launchers) > 0):
            for 
index in self.launchers:
                
launcher self.launchers[index]
                
self._add_launcher(launcher["name"], launcher["application"], launcher["rompath"], launcher["romext"], launcher["thumb"], launcher["wait"], launcher["roms"], len(self.launchers))
            
xbmcplugin.endOfDirectoryhandle=intself._handle ), succeeded=TruecacheToDisc=False )
... 
change to
PHP Code:
def _get_launchersself ):
...
        if (
len(self.launchers) > 0):
            for 
key in sorted(self.launchers.iterkeys()):
                
self._add_launcher(self.launchers[key]["name"], self.launchers[key]["application"], self.launchers[key]["rompath"], self.launchers[key]["romext"], self.launchers[key]["thumb"], self.launchers[key]["wait"], self.launchers[key]["roms"], len(self.launchers))
            
xbmcplugin.endOfDirectoryhandle=intself._handle ), succeeded=TruecacheToDisc=False )
... 

and save the file
now delete "XBMC\plugins\Programs\Launcher\resources\lib\laun cher_plugin.pyo" and try it out.

Tested with Launcher 1.04 and XBMC 9.11-a2 on WinXP64


- leo2 - 2009-11-19

is this sort solution is backward compatible? I mean, will it work on XBMC 8.10?


- leo2 - 2009-11-19

fix commited to svn


- fablog - 2009-11-20

Thanks for the advice JustSomeUser Smile