cron-rest-eyes: do not run while gnome-screensaver is active
This commit is contained in:
parent
ad019bf846
commit
2971e5b45b
@ -1,10 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# no message if one is displayed already
|
||||
if [[ "`ps -efww | grep -v grep | grep gxmessage`" == "" ]]; then
|
||||
# no message if screensaver active
|
||||
if [ "`ps -efww | grep -v grep | grep xscreensaver`" == "" ]; then
|
||||
export DISPLAY=:0
|
||||
gxmessage 'Rest your eyes!'
|
||||
fi
|
||||
if [[ "$(ps -efww | grep -v grep | grep gxmessage)" != "" ]]; then
|
||||
exit
|
||||
fi
|
||||
# no message if xscreensaver active
|
||||
if [ "$(ps -efww | grep -v grep | grep xscreensaver)" != "" ]; then
|
||||
exit
|
||||
fi
|
||||
# no message if gnome-screensaver active
|
||||
if [ "$(gnome-screensaver-command --query | grep is.active)" != "" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
export DISPLAY=:0
|
||||
gxmessage 'Rest your eyes!'
|
||||
|
Loading…
x
Reference in New Issue
Block a user