mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 04:31:09 +00:00
37 lines
753 B
Bash
Executable file
37 lines
753 B
Bash
Executable file
#!/bin/sh
|
|
set -eu
|
|
|
|
# PID of "gnome-screensaver-command -i" (if used)
|
|
GSC_PID=""
|
|
|
|
# if gnome-screensaver is running in the background..
|
|
if ps auxww | grep -q 'gnome-screensaver'; then
|
|
echo "inhibiting gnome screensaver"
|
|
gnome-screensaver-command -i &
|
|
# save the PID of the last command
|
|
GSC_PID="$!"
|
|
fi
|
|
|
|
# Stop unclutter
|
|
if ps auxww | grep -q 'unclutter'; then
|
|
echo 'inhibiting unclutter'
|
|
killall -STOP unclutter
|
|
fi
|
|
|
|
# enable core dumps
|
|
ulimit -c unlimited
|
|
|
|
# run quake 2
|
|
./quake2 "$@"
|
|
|
|
# Continue unclutter
|
|
if ps auxww | grep -q 'unclutter'; then
|
|
echo 'reactivating unclutter'
|
|
killall -CONT unclutter
|
|
fi
|
|
|
|
# if gnome-screensaver was running..
|
|
if [ -n "$GSC_PID" ]; then
|
|
echo "reactivating gnome screensaver"
|
|
kill "$GSC_PID"
|
|
fi
|