Author: Not specified Language: bash
Description: Not specified Timestamp: 2012-11-07 12:36:49 -0500
View raw paste Child paste by: Not specified Reply
  1. #!/bin/sh
  2.  
  3. # these variables can be overridden on commandline
  4. WORKDIR="$(pwd)"
  5. DESKTOPFILE="$WORKDIR/steam.desktop"
  6. LAUNCHSTEAMDIR=~/Steam
  7. LAUNCHSTEAMPLATFORM=ubuntu12_32
  8. LAUNCHSTEAMBIN=$LAUNCHSTEAMDIR/$LAUNCHSTEAMPLATFORM
  9. LAUNCHSTEAMBOOTSTRAP=$LAUNCHSTEAMDIR/steam.sh
  10. LAUNCHSTEAMBOOTSTRAPFILE="$WORKDIR/bootstraplinux_$LAUNCHSTEAMPLATFORM.tar.xz"
  11. EXELINK=~/.steampath # full path of steam (~/Steam/ubuntu12_32/steam)
  12. STEAMROOTLINK=~/.steam/root # used by games to find the steam install directory (~/Steam)
  13.  
  14. if ! [ -x "$LAUNCHSTEAMBOOTSTRAP" ]; then
  15.         # user does not have steam set up yet, do some sanity checks and set it up
  16.         echo "Setting up steam platform in $LAUNCHSTEAMDIR"
  17.         mkdir -p "$LAUNCHSTEAMDIR"
  18.         cd "$LAUNCHSTEAMDIR"
  19.         tar -xvJf "$LAUNCHSTEAMBOOTSTRAPFILE" ||
  20.                 { echo "Failed to extract $LAUNCHSTEAMBOOTSTRAPFILE, aborting installation."
  21.                 exit 1 ;}
  22.  
  23.         # create the symlinks in the user's home directory
  24.         [ -e ~/.steam ] || mkdir ~/.steam
  25.        
  26.         rm -f ${EXELINK} && ln -s "${LAUNCHSTEAMBIN}"/steam ${EXELINK}
  27.         rm -f ${STEAMROOTLINK} && ln -s "${LAUNCHSTEAMDIR}" ${STEAMROOTLINK}
  28.  
  29.         # put the Steam icon on the user's desktop
  30.         # try to read ~/.config/user-dirs.dirs to get the current desktop directory
  31.         # http://www.freedesktop.org/wiki/Software/xdg-user-dirs
  32.         test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs
  33.         DESKTOP_DIR=${XDG_DESKTOP_DIR:-$HOME/Desktop}
  34.        
  35.         cp "${DESKTOPFILE}" "${DESKTOP_DIR}"
  36.         chmod +x "${DESKTOP_DIR}/steam.desktop"
  37. fi
  38.  
  39. # go to the install directory and run the client
  40. LAUNCHSTEAMDIR=`readlink -e $STEAMROOTLINK`
  41. cd $LAUNCHSTEAMDIR
  42. exec "$LAUNCHSTEAMDIR/steam.sh" $*
  43.  
View raw paste Child paste by: Not specified Reply