diff options
author | Ananth Bhaskararaman | 2016-02-18 13:59:15 +0530 |
---|---|---|
committer | Ananth Bhaskararaman | 2016-02-18 13:59:15 +0530 |
commit | fb0b3df2c74dd551714f0e5f6fd44f9f5bb564f9 (patch) | |
tree | 7f09ae187a4d28843af14c7b9e1eb412d187735d | |
download | aur-fb0b3df2c74dd551714f0e5f6fd44f9f5bb564f9.tar.gz |
Cleaned up history for aur
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | PKGBUILD | 24 | ||||
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | readme.install | 30 | ||||
-rwxr-xr-x | steam-de | 99 | ||||
-rw-r--r-- | steam.service | 17 |
7 files changed, 206 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..66b60455c013 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +# Generated by mksrcinfo v8 +# Tue Jan 26 10:31:27 UTC 2016 +pkgbase = steam-standalone + pkgdesc = Systemd service and user to run steam stand-alone in big picture mode + pkgver = 0.2 + pkgrel = 1 + url = https://github.com/ananthb/steam-standalone + install = readme.install + arch = x86_64 + arch = i686 + license = GPL + depends = systemd + depends = xorg-server + depends = xorg-xinit + depends = steam + depends = polkit + depends = wmctrl + depends = xfwm4 + source = https://github.com/ananthb/steam-standalone/releases/download/0.2/files.tar.gz + sha256sums = cdd565f50a4b89719c73b403e4c552584428c4f77db2401f0eba794ab0396174 + +pkgname = steam-standalone + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..a9ff54e850b3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +files.tar.gz +src/ +pkg/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c509d0acbd9d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,24 @@ +# Maintainer: Ananth Bhaskararaman + +pkgname=steam-standalone +pkgver=0.2 +pkgrel=1 +pkgdesc="Systemd service and user to run steam stand-alone in big picture mode" +url="https://github.com/ananthb/steam-standalone" +# Arch ARM users do NOT attempt to use this package on Arch ARM! +# This is only for x86_64 and i686. You have been warned. +arch=('x86_64' 'i686') +license=('GPL') +depends=('systemd' 'xorg-server' 'xorg-xinit' 'steam' 'polkit' 'wmctrl' 'xfwm4') +install=readme.install +source=("https://github.com/ananthb/$pkgname/releases/download/$pkgver/files.tar.gz") +sha256sums=('cdd565f50a4b89719c73b403e4c552584428c4f77db2401f0eba794ab0396174') + +package() { + install -Dm644 "$srcdir/steam.service" \ + "$pkgdir/usr/lib/systemd/system/steam.service" + install -Dm755 "$srcdir/steam-de" \ + "$pkgdir/usr/bin/steam-de" + install -dm 700 "$pkgdir"/var/lib/steam + chown 540:540 "$pkgdir"/var/lib/steam +} diff --git a/README.md b/README.md new file mode 100644 index 000000000000..68f7bd44aff9 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# steam-standalone +Run steam in big picture mode without a DE + +## Dependency List +* polkit +* systemd +* xorg-server with xorg-xinit + +## Credit +Credit for this package almost entirely belongs to graysky2(https://github.com/graysky2) and his kodi-standalone-service package. diff --git a/readme.install b/readme.install new file mode 100644 index 000000000000..df9c1ef140c8 --- /dev/null +++ b/readme.install @@ -0,0 +1,30 @@ +post_install() { + getent group steam > /dev/null || groupadd -g 540 steam + if ! getent passwd steam > /dev/null; then + useradd -c 'Steam user' -u 540 -g steam -G audio,video,network,optical \ + -d /var/lib/steam -s /usr/bin/nologin steam + passwd -l steam > /dev/null + fi +} + +post_upgrade() { + post_install $1 + if ! getent group steam | cut -d: -f3 | grep 540 > /dev/null 2>&1; then + groupmod -g 540 steam > /dev/null 2>&1 + fi + if ! id -u steam | grep 540 > /dev/null 2>&1; then + usermod -u 420 steam > /dev/null 2>&1 + if [[ $? -ne 0 ]]; then + echo "Changing uid of user steam failed." + echo "It is recommended that the uid is changed." + echo "Stop all processes running under the steam user and reinstall steam" + echo "or change the uid manually. (usermod -u 420 steam)" + fi + chown -R steam:steam /var/lib/steam + fi +} + +post_remove() { + getent passwd steam > /dev/null 2>&1 && userdel steam + getent group steam > /dev/null 2>&1 && groupdel steam +} diff --git a/steam-de b/steam-de new file mode 100755 index 000000000000..91a3e97b50e8 --- /dev/null +++ b/steam-de @@ -0,0 +1,99 @@ +#!/bin/bash +#STEAM DE - Script for starting Steam at login +#Copyright (C) 2012 Thomaz de Oliveira dos Reis <thor27@gmail.com> +# +#This program is free software; you can redistribute it and/or +#modify it under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version 2 +#of the License, or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +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 + +parameters='-tenfoot -enableremotecontrol' + +#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` + +export SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0 + +# Disable DPMS and screen blanking +xset -dpms +xset s off + +#Execute STEAM +$prefix $program $parameters & +PID=$! + +while ! check_steam_window +do + sleep 0.5 + if ! ps -p $PID + then + zenity --error --text "Ops! Steam had some trouble to run. That can be a problem with steam itself or with your configuration." + exit 1 + fi +done + +while check_steam_window +do + sleep 10 +done + +#Exit steam nicely... +steam -shutdown diff --git a/steam.service b/steam.service new file mode 100644 index 000000000000..01ff6afa5795 --- /dev/null +++ b/steam.service @@ -0,0 +1,17 @@ +[Unit] +Description = Starts instance of steam in big picture mode using xinit +After = systemd-user-sessions.service network.target sound.target +Conflicts=getty@tty7.service + +[Service] +User = steam +Group = steam +PAMName = login +Type = simple +TTYPath = /dev/tty7 +ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/steam-de -- :0 -nolisten tcp vt7 +Restart = on-abort +StandardInput = tty + +[Install] +WantedBy = multi-user.target |