File: quake2-start.sh

package info (click to toggle)
yquake2 5.21~dfsg1-2
  • links: PTS, VCS
  • area: contrib
  • in suites: jessie, jessie-kfreebsd
  • size: 3,448 kB
  • ctags: 12,967
  • sloc: ansic: 95,860; makefile: 567; sh: 51
file content (37 lines) | stat: -rwxr-xr-x 753 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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