Hi.
In my IceWM startup script I have:
Code:
[[ $(ps ax | grep "[s]cript-disable-screensaver") ]] || /all/script-disable-screensaver.sh &
And in that script I have:
Code:
#!/bin/bash
while true
do
sleep 400
xset -dpms
xset s off
xset s noblank
done
Because X forgets those settings over time and turns on screensaver.
The problem is that when I terminate X, script continues to work and on next iteration starts to output errors that screen is not found. How can I make this script to self-terminate if one more iteration comes and X is not running?