mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Simplify usage of $GSC_PID.
This commit is contained in:
parent
d3fa38bca9
commit
7c4daf24b1
1 changed files with 4 additions and 4 deletions
|
@ -1,14 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
# PID of "gnome-screensaver-command -i" (if used)
|
||||
GSC_PID=0
|
||||
GSC_PID=""
|
||||
|
||||
# if gnome-screensaver is running in the background..
|
||||
if [ $(ps auxww | grep gnome-screensaver | wc -l) -gt 0 ]; then
|
||||
echo "inhibiting gnome screensaver"
|
||||
gnome-screensaver-command -i &
|
||||
# save the PID of the last command
|
||||
GSC_PID=$!
|
||||
GSC_PID="$!"
|
||||
fi
|
||||
|
||||
# Stop unclutter
|
||||
|
@ -24,9 +24,9 @@ ulimit -c unlimited
|
|||
./quake2 $*
|
||||
|
||||
# if gnome-screensaver was running..
|
||||
if [ $GSC_PID -gt 0 ]; then
|
||||
if [ -n "$GSC_PID" ]; then
|
||||
echo "reactivating gnome screensaver"
|
||||
kill $GSC_PID
|
||||
kill "$GSC_PID"
|
||||
fi
|
||||
|
||||
# Continue unclutter
|
||||
|
|
Loading…
Reference in a new issue