2012-04-29 13:57:33 +00:00
|
|
|
#!/bin/sh
|
2012-04-29 15:16:36 +00:00
|
|
|
set -eu
|
2010-02-24 15:43:59 +00:00
|
|
|
|
2012-04-29 13:57:33 +00:00
|
|
|
# PID of "gnome-screensaver-command -i" (if used)
|
2012-04-29 15:20:10 +00:00
|
|
|
GSC_PID=""
|
2010-02-24 15:43:59 +00:00
|
|
|
|
2012-04-29 13:57:33 +00:00
|
|
|
# if gnome-screensaver is running in the background..
|
2012-04-29 15:17:54 +00:00
|
|
|
if ps auxww | grep -q 'gnome-screensaver'; then
|
2012-04-29 13:57:33 +00:00
|
|
|
echo "inhibiting gnome screensaver"
|
|
|
|
gnome-screensaver-command -i &
|
|
|
|
# save the PID of the last command
|
2012-04-29 15:20:10 +00:00
|
|
|
GSC_PID="$!"
|
2012-04-29 13:57:33 +00:00
|
|
|
fi
|
2010-02-24 15:43:59 +00:00
|
|
|
|
2011-10-04 19:14:11 +00:00
|
|
|
# Stop unclutter
|
2012-04-29 15:17:54 +00:00
|
|
|
if ps auxww | grep -q 'unclutter'; then
|
2011-10-04 19:14:11 +00:00
|
|
|
echo 'inhibiting unclutter'
|
|
|
|
killall -STOP unclutter
|
|
|
|
fi
|
|
|
|
|
2012-04-29 14:56:07 +00:00
|
|
|
# enable core dumps
|
|
|
|
ulimit -c unlimited
|
|
|
|
|
2012-04-29 13:57:33 +00:00
|
|
|
# run quake 2
|
|
|
|
./quake2 $*
|
2010-02-24 15:43:59 +00:00
|
|
|
|
2012-04-29 15:15:27 +00:00
|
|
|
<<<<<<< HEAD
|
2012-04-29 13:57:33 +00:00
|
|
|
# if gnome-screensaver was running..
|
2012-04-29 15:20:10 +00:00
|
|
|
if [ -n "$GSC_PID" ]; then
|
2012-04-29 13:57:33 +00:00
|
|
|
echo "reactivating gnome screensaver"
|
2012-04-29 15:20:10 +00:00
|
|
|
kill "$GSC_PID"
|
2010-02-24 15:43:59 +00:00
|
|
|
fi
|
2011-10-04 19:14:11 +00:00
|
|
|
|
2012-04-29 15:15:27 +00:00
|
|
|
=======
|
|
|
|
>>>>>>> f3edcfc... Reactivate gnome-screensaver and unclutter in the reverse order they are deactivated.
|
2011-10-04 19:14:11 +00:00
|
|
|
# Continue unclutter
|
2012-04-29 15:17:54 +00:00
|
|
|
if ps auxww | grep -q 'unclutter'; then
|
2011-10-04 19:14:11 +00:00
|
|
|
echo 'reactivating unclutter'
|
|
|
|
killall -CONT unclutter
|
|
|
|
fi
|
2012-04-29 15:15:27 +00:00
|
|
|
|
|
|
|
# if gnome-screensaver was running..
|
|
|
|
if [ $GSC_PID -gt 0 ]; then
|
|
|
|
echo "reactivating gnome screensaver"
|
|
|
|
kill $GSC_PID
|
|
|
|
fi
|