Launching apps from XBMCbuntu Edenon. 11 april 2012
I just replaced an old Ubuntu install with the fresh live CD carrying XBMC. It has now been named XBMCbuntu, noting its inheritance a bit more than earlier. While running XBMCbuntu has its benefits with a pre-made nicely working setup of XBMC, it lacks direct access to applications like a web browser and for instance Spotify. One can boot up the LXDE desktop environment when logging in instead of starting XBMC in full screen, but that is kind of tedious if one wants the default behaviour to be a full screen home theatre PC.
Luckily there is an add-on called Advanced Launcher that you'll find under "System > Settings > Add-Ons > Get more" in XBMC, but even though this includes a Chromium launcher by default, it fails to launch anything properly. Chromium is for instance launched without the maximize and close buttons, and on my first attempt, the URL bar was even gone. The reason is simple; when launching a command using the Advanced Launcher, it has not yet opened a window manager such as Openbox, which I believe is default in LXDE. The solution for me was found in this blog post, over at Setup Guides, where James Cole suggests adding a script that launches openbox before launching Chromium. And kills Openbox when Chromium is closed.
However, the solution proposed there works only for Chromium and you'll have to set up a similar script for all applications you'd like to launch from XBMC. That isn't too much work, but I figured one could make the script from Setup Guides a bit more general, taking the application to launch as an argument instead.
So the setup goes as follows:
- Install XBMC and the Advanced Launcher add-on
Create a script with the following contents and save it somewhere in your home folder (to make it easily accesible from XBMC)
1 2 3 4
#!/bin/bash openbox & $1 killall -9 openbox
Start the Advanced Launcher add-on
- Right click (or press C on the keyboard) and select "Create New Launcher"
- Select your script as the executable
- Type the command you want to run as the argument. This could for instance be "chromium-browser" or "spotify"
- Enjoy your new launcher!
To launch Spotify you'll of course have to install that first. To do so, you might add a launcher to lxterm and follow the instructions on Spotify's webpages.
Thanks to James @ Setup Guides for posting the original script.