[RELEASE] Steam Launcher - Start Steam Big Picture Mode from within Kodi
v1.1.1

Quote:Added fix from 1.0.5 to OSX portion of steam-launch.sh
In linux section of steam-launch.sh the 3rd argument is passed to the pre-steam script. This is for my linux system.
Preliminary SteamOS support. The addon assumes you are running xbmc in the desktop session and when run switches to the steam session (same as the desktop icon). Only option available with SteamOS is 'Quit XBMC' (not quitting XBMC when using the gnome desktop causes problems with Steam on my test system).

For SteamOS users: You can install XBMC 13 from here. By simply adding XBMC to Steam it will run as the steam user and from what I've read it can cause problems, so to avoid this you can use two other methods to launch XBMC - Launch XBMC in its own session (replaces the Desktop session) or launching XBMC in the Gnome desktop session. If you want to launch external programs from XBMC (such as emulators, web browsers etc) it's probably best to run xbmc ontop of the Gnome desktop.

* XBMC ontop of Gnome desktop:
Firstly, you need the program wmctrl installed. Then create a new desktop entry to launch XBMC as the desktop user (there will be two entries for XBMC so you can still run XBMC as the steam user - if you use XBMC as both users you will probably want to symlink/bind mount the two ~/.xbmc directories so you can share user settings/addons/etc..). The new XBMC entry will be called just "XBMC":

/usr/share/applications/xbmc-sl.desktop
Code:
[Desktop Entry]
Version=1.0
Name=XBMC
GenericName=Media Center
Comment=Manage and view your media
Exec=/usr/bin/xbmc-sl.sh
Icon=xbmc
Terminal=false
Type=Application
Categories=AudioVideo;Video;Player;TV;

Steam doesnt like desktop entries using commands with prefixes (in this case sudo), so two script files are necessary - one for steam to launch, which in turn launches the second with sudo rights (this is needed as commands are being executed for different users)

/usr/bin/xbmc-sl.sh
Code:
sudo /usr/bin/xbmc-sl2.sh

/usr/bin/xbmc-sl2.sh
Code:
#!/bin/bash

dbus-send --system --print-reply --dest=org.freedesktop.DisplayManager  /org/freedesktop/DisplayManager/Seat0 org.freedesktop.DisplayManager.Seat.SwitchToUser string:'desktop' string:''

export DISPLAY=:1

until [[ $(sudo -u desktop wmctrl -l |grep "Desktop$") ]] ; do
        sleep 1
done

if [[ $(pidof xbmc.bin) ]] ; then
        sudo -u desktop wmctrl -r "XBMC Media Center" -b add,fullscreen &
else
        sudo -u desktop xbmc &
fi

Make both script files executable. Now to edit the sudoers file to allow the above to be executed without a password prompt. Run sudo visudo and add the following to the end:
Code:
%steam ALL = NOPASSWD: /usr/bin/xbmc-sl2.sh
%desktop ALL = NOPASSWD: /usr/bin/xbmc-sl2.sh

Also disable the password prompt when switching to desktop mode:
Code:
gsettings set org.gnome.desktop.lockdown disable-lock-screen 'true'

Now add the new XBMC entry to Steam as a external program.
Done!

* Running XBMC in its own session:
You can run XBMC in its own session by replacing the desktop session (note you will lose easy access to the desktop, and running other programs in the xbmc session, such as browsers or emulators, may have problems). In the /usr/share/xsessions directory rename gnome.desktop (i had to rename gnome-fallback.desktop due to using a VM) to have .bak extensions. Then copy XBMC.desktop to gnome.desktop (or gnome-fallback.desktop if necessary). Some extra steps are necessary to prevent XBMC from automatically restarting:

/usr/share/applications/xbmc-sl.desktop
Code:
[Desktop Entry]
Version=1.0
Name=XBMC
GenericName=Media Center
Comment=Manage and view your media
Exec=/usr/bin/xbmc-sl.sh
Icon=xbmc
Terminal=false
Type=Application
Categories=AudioVideo;Video;Player;TV;

/usr/bin/xbmc-sl.sh
Code:
#!/bin/bash

rm -rf /tmp/xbmc.disabled
dbus-send --system --print-reply --dest=org.freedesktop.DisplayManager  /org/freedesktop/DisplayManager/Seat0 org.freedesktop.DisplayManager.Seat.SwitchToUser string:'desktop' string:''

/usr/bin/xbmc-sl
Code:
#!/bin/bash

while [[ -f /tmp/xbmc.disabled ]] ; do
        sleep 1
done

xbmc $@

/usr/bin/xbmc-pre-steam (you need to point the Steam-Launcher addon to use this as the pre-steam script)
Code:
#!/bin/bash

touch /tmp/xbmc.disabled

copy /usr/bin/xbmc-standalone to /usr/bin/xbmc-standalone-sl and edit it and make the XBMC= command look like
Code:
XBMC="${bindir}/xbmc-sl --standalone $@"

Now edit /usr/share/xsessions/gnome.dektop and change xbmc-standalone to xbmc-standalone-sl
Make sure all files created are executable
NOTE: this breaks 'Return to desktop' in steam bpm, so disable 'Access to the linux desktop' in steam's settings.

That does it, enjoy!

I don't use SteamOS a great deal so suggestions are welcome.
Reply


Messages In This Thread
RE: [RELEASE] Steam Launcher - by DJ_Izumi - 2013-04-26, 06:47
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-04-26, 23:55
RE: [RELEASE] Steam Launcher - by DJ_Izumi - 2013-05-11, 19:55
RE: [RELEASE] Steam Launcher - by inque54 - 2013-05-11, 05:27
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-11, 06:39
RE: [RELEASE] Steam Launcher - by inque54 - 2013-05-11, 08:13
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-11, 10:07
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-12, 04:18
RE: [RELEASE] Steam Launcher - by inque54 - 2013-05-12, 05:06
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-12, 05:48
RE: [RELEASE] Steam Launcher - by inque54 - 2013-05-12, 06:29
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-12, 08:55
RE: [RELEASE] Steam Launcher - by inque54 - 2013-05-12, 08:58
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-12, 09:56
RE: [RELEASE] Steam Launcher - by inque54 - 2013-05-12, 10:49
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-13, 00:15
RE: [RELEASE] Steam Launcher - by inque54 - 2013-05-13, 04:02
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-13, 13:02
RE: [RELEASE] Steam Launcher - by inque54 - 2013-05-14, 08:39
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-14, 09:00
RE: [RELEASE] Steam Launcher - by inque54 - 2013-05-14, 09:35
RE: [RELEASE] Steam Launcher - by K3v1 - 2013-05-15, 21:14
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-15, 21:36
RE: [RELEASE] Steam Launcher - by K3v1 - 2013-05-16, 14:13
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-16, 23:37
RE: [RELEASE] Steam Launcher - by K3v1 - 2013-05-20, 20:04
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-23, 10:58
RE: [RELEASE] Steam Launcher - by bassdal - 2013-05-29, 00:17
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-29, 01:34
RE: [RELEASE] Steam Launcher - by bassdal - 2013-05-29, 02:50
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-05-29, 04:47
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-06-10, 08:41
RE: [RELEASE] Steam Launcher - by mohanman - 2013-07-07, 01:20
RE: [RELEASE] Steam Launcher - by mohanman - 2013-07-11, 13:18
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-07-12, 01:08
RE: [RELEASE] Steam Launcher - by relaxis - 2013-07-09, 11:38
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-07-09, 12:38
RE: [RELEASE] Steam Launcher - by Stildawn - 2013-07-13, 03:15
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-07-13, 06:11
RE: [RELEASE] Steam Launcher - by Stildawn - 2013-07-14, 22:47
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-07-14, 23:45
RE: [RELEASE] Steam Launcher - by Stildawn - 2013-07-15, 00:27
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-07-17, 09:43
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-07-18, 06:33
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-07-18, 15:21
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-08-03, 09:05
RE: [RELEASE] Steam Launcher - by NorDemoniac - 2013-08-24, 15:19
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-08-25, 04:46
RE: [RELEASE] Steam Launcher - by NorDemoniac - 2013-08-26, 12:28
RE: [RELEASE] Steam Launcher - by MeMeMe - 2013-08-29, 18:30
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-08-29, 23:39
RE: [RELEASE] Steam Launcher - by MeMeMe - 2013-08-30, 00:01
RE: [RELEASE] Steam Launcher - by xeibo - 2013-09-01, 15:58
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-09-01, 22:45
RE: [RELEASE] Steam Launcher - by Megatron - 2013-09-02, 05:38
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-09-02, 08:43
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-09-04, 09:24
RE: [RELEASE] Steam Launcher - by xeibo - 2013-09-04, 14:48
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-09-04, 23:55
RE: [RELEASE] Steam Launcher - by MeMeMe - 2013-09-05, 03:19
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-09-05, 04:19
RE: [RELEASE] Steam Launcher - by MeMeMe - 2013-09-05, 04:59
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-09-05, 14:38
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-09-06, 15:29
RE: [RELEASE] Steam Launcher - by buymeapc - 2013-09-06, 18:49
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-09-07, 02:37
RE: [RELEASE] Steam Launcher - by MeMeMe - 2013-09-07, 20:39
RE: [RELEASE] Steam Launcher - by MeMeMe - 2013-09-14, 11:24
RE: [RELEASE] Steam Launcher - by edru - 2013-09-18, 04:56
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-09-18, 08:37
RE: [RELEASE] Steam Launcher - by bwall244 - 2013-09-26, 01:00
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-09-26, 01:09
RE: [RELEASE] Steam Launcher - by aoaaron - 2013-10-04, 02:39
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-10-04, 07:07
RE: [RELEASE] Steam Launcher - by MeMeMe - 2013-10-04, 02:43
RE: [RELEASE] Steam Launcher - by aoaaron - 2013-10-04, 18:19
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-10-05, 01:36
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-10-23, 05:43
RE: [RELEASE] Steam Launcher - by MeMeMe - 2013-10-23, 20:03
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-10-24, 05:35
RE: [RELEASE] Steam Launcher - by Booza - 2013-10-26, 00:58
RE: [RELEASE] Steam Launcher - by MeMeMe - 2013-10-26, 01:30
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-10-26, 08:30
RE: [RELEASE] Steam Launcher - by MeMeMe - 2013-10-26, 14:11
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-10-27, 10:05
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-11-02, 02:08
RE: [RELEASE] Steam Launcher - by Booza - 2013-11-03, 19:17
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-11-03, 20:44
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-11-04, 08:00
RE: [RELEASE] Steam Launcher - by culprit - 2013-11-06, 23:47
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-11-07, 02:50
RE: [RELEASE] Steam Launcher - by culprit - 2013-11-07, 09:10
RE: [RELEASE] Steam Launcher - by wagnumpi - 2013-11-09, 01:24
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-11-09, 01:34
RE: [RELEASE] Steam Launcher - by wagnumpi - 2013-11-09, 14:03
RE: [RELEASE] Steam Launcher - by DJ_Izumi - 2013-12-05, 03:36
RE: [RELEASE] Steam Launcher - by BraveBuc - 2013-12-06, 06:47
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-12-06, 12:41
RE: [RELEASE] Steam Launcher - by BraveBuc - 2013-12-06, 15:50
RE: [RELEASE] Steam Launcher - by bs0d - 2013-12-13, 05:21
RE: [RELEASE] Steam Launcher - by jeayese - 2013-12-13, 06:03
RE: [RELEASE] Steam Launcher - by Excelsis - 2013-12-13, 11:30
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-12-14, 00:45
RE: [RELEASE] Steam Launcher - by Excelsis - 2013-12-14, 12:34
RE: [RELEASE] Steam Launcher - by bakito - 2013-12-19, 20:10
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-12-20, 00:28
RE: [RELEASE] Steam Launcher - by ComeGetIt - 2013-12-20, 10:33
RE: [RELEASE] Steam Launcher - by DJ_Izumi - 2013-12-20, 19:39
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-12-21, 00:20
RE: [RELEASE] Steam Launcher - by DJ_Izumi - 2013-12-21, 00:27
RE: [RELEASE] Steam Launcher - by ComeGetIt - 2013-12-22, 11:47
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-12-22, 23:51
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-12-23, 14:49
RE: [RELEASE] Steam Launcher - by teeedubb - 2013-12-25, 04:07
RE: [RELEASE] Steam Launcher - Start Steam Big Picture Mode from within XBMC - by teeedubb - 2014-06-28, 05:19
Error on load - by easytc - 2014-08-17, 12:52
Logout Mark Read Team Forum Stats Members Help
[RELEASE] Steam Launcher - Start Steam Big Picture Mode from within Kodi7