HOW TO: Steam BPM XSession

Home Forums Tech Support HOW TO: Steam BPM XSession

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #65694
    Pedro Mateus
    Keymaster

    So you want to have your own HTPC with Steam. Thankfully, you’re a sane person and you don’t want to use Ubuntu or even wait for Valve Time SteamOS in order to do it.

    Fair is fair and if you’re using Fedora/Korora/etc. this one’s for you.

    This tutorial was adapted from Thor27’s “steam-login” (https://github.com/thor27/steam-login).

    1. Fire up your terminal of choice and run:

    Quote:
    sudo leafpad /usr/bin/steam-de

    (Feel free to replace leafpad with whichever text editor you prefer)

    2. Copy Thor27’s script into the new file:

    Quote:
    #!/bin/bash
    #STEAM DE – Script for starting Steam at login
    #Copyright (C) 2012 Thomaz de Oliveira dos Reis function stop(){
    #Stop all running steam process
    killall steam.sh
    killall steam
    killall MainThrd
    #If it doesn’t stop, force it
    killall -9 steam
    killall -9 steam.sh
    killall -9 MainThrd

    }

    function check_steam_window(){
    wmctrl -l | tr -s ” ” | cut -f4- -d” ” | grep ‘^Steam$’
    }

    function disable_joysticks() {
    for dev in `find /dev/input -name js*`; do
    # Get the name of the joystick model
    name=”`udevadm info –query=property –name=$dev | grep ID_VENDOR_ENC | cut -c15- -` `udevadm info –query=property –name=$dev | grep ID_MODEL_ENC | cut -c14- -`”
    # Escape sequences
    name=”`echo -e “$name”`”
    # Disable the joystick
    xinput –list | grep “$name” | grep -Pwo “id=[0-9]*” | grep -Pwo “[0-9]*” | xargs xinput –disable
    done
    }

    stop

    # Start basic window manager and video settings
    xfwm4 –replace –daemon –compositor=off
    which nvidia-settings && nvidia-settings -l
    which gnome-settings-daemon && gnome-settings-daemon &

    # Disable xinput for joysticks
    if [ -x /usr/bin/xinput ]; then
    disable_joysticks
    fi

    #Reset variables
    unset prefix
    unset parameters
    unset program

    # -bigpicture does not work anymore
    #parameters=’-bigpicture’
    parameters=’-tenfoot’

    #Set optirun as prefix if available
    which optirun && prefix=optirun

    #Set primusrun as prefix if available
    which primusrun && prefix=vblank_mode=0 optirun -b primus
    #Get full path of steam executable
    program=`which steam`

    #Execute STEAM
    $prefix $program $parameters &
    PID=$!
    while ! check_steam_window
    do
    sleep 0.5
    if ! ps -p $PID
    then
    zenity –error –text “You done goofed! That can be a problem with either Steam itself or your configuration.”
    exit 1
    fi
    done

    while check_steam_window
    do
    sleep 10
    done

    #Exit steam nicely…
    steam [url=steam://ExitSteam]steam://ExitSteam[/url]

    3. Save, exit and make it executable:

    Quote:
    sudo chmod +x /usr/bin/steam-de

    4. Make a new text file to use as a launcher for the above script:

    Quote:
    sudo leafpad /usr/share/xsessions/steam-bigpicture.desktop

    5. Paste this into it:

    Quote:
    [Desktop Entry]
    Name=Steam
    Comment=Steam Big Picture Mode Session
    Exec=steam-de
    Icon=steam
    Type=Application

    6. Save, exit and chmod this one as well:

    Quote:
    sudo chomd +x /usr/share/xsessions/steam-bigpicture.desktop

    (This step is Fedora/Derivative specific) 7. Install the dependencies:

    Quote:
    sudo yum install xfwm4 wmctrl joystick

    8. If you’re using an up-to-date DM, it should pick up the .desktop file automatically. If not, Google it!

    9. Log out of your DE and choose the Steam session on your DM’s options.

    10. Enjoy!

    P.S.: I don’t know how well this will work with WiFi, probably won’t. Wired Internet works perfectly.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.