mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Simplify "[ $($FOO | grep $BAR | wc -l) -gt 0 ]" to "$FOO | grep -q $BAR".
This commit is contained in:
parent
7c4daf24b1
commit
3247c952a4
1 changed files with 3 additions and 3 deletions
|
@ -4,7 +4,7 @@
|
|||
GSC_PID=""
|
||||
|
||||
# if gnome-screensaver is running in the background..
|
||||
if [ $(ps auxww | grep gnome-screensaver | wc -l) -gt 0 ]; then
|
||||
if ps auxww | grep -q 'gnome-screensaver'; then
|
||||
echo "inhibiting gnome screensaver"
|
||||
gnome-screensaver-command -i &
|
||||
# save the PID of the last command
|
||||
|
@ -12,7 +12,7 @@ if [ $(ps auxww | grep gnome-screensaver | wc -l) -gt 0 ]; then
|
|||
fi
|
||||
|
||||
# Stop unclutter
|
||||
if [ $(ps auxww | grep unclutter | wc -l) -gt 0 ]; then
|
||||
if ps auxww | grep -q 'unclutter'; then
|
||||
echo 'inhibiting unclutter'
|
||||
killall -STOP unclutter
|
||||
fi
|
||||
|
@ -30,7 +30,7 @@ if [ -n "$GSC_PID" ]; then
|
|||
fi
|
||||
|
||||
# Continue unclutter
|
||||
if [ $(ps auxww | grep unclutter | wc -l) -gt 0 ]; then
|
||||
if ps auxww | grep -q 'unclutter'; then
|
||||
echo 'reactivating unclutter'
|
||||
killall -CONT unclutter
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue