[ltp] Getting screensaver to ignore mouse movement?
Richard Neill
linux-thinkpad@linux-thinkpad.org
Tue, 13 Mar 2007 00:31:43 +0000
Richard Neill wrote:
>>
>>> One supplementary bug. xscreensaver now fails to put the display into
>>> power-off mode. This is definitely a bug. Manually setting DPMS
>>> timeouts (xset dpms xxx yyy zzz) does work. But if I let
>>> xscreensaver set the same values, it doesn't. "xset dpms force off"
>>> does what I want.
>>
>> Couldn't tell you here. I don't typically use any screensaver
>> programs except "blank screen" and "xset dpms force off".
>
Here's the script. It seems to work. For some reason, although
xscreensaver reconfigures the DPMS settings, the new settings are not
honoured. This is a workaround.
-------------------
[rjn@mocha ~]$ cat bin/xscreensaver_dpms.sh
#!/bin/bash
#Xscreensaver on Thinkpad X20 / Ubuntu Edgy doesn't play nice with DPMS.
#Even if we already did `xset dpms 1800 1800 1800`, xscreensaver
#somehow breaks this.
NUM=5 #Show this many hacks before powering off display.
#(switch off on the NUM+1 th)
echo "Running xscreensaver_monitor. Will force DPMS off after $NUM hacks
have been shown."
COUNT=0
#Watch the xscreensaver status. When unblanking, the line will
#begin 'UNBLANK'
xscreensaver-command -watch | while read LINE; do
if echo $LINE | grep 'RUN' &>/dev/null 2>&1 ; then
let COUNT++ #increment count
echo "Blank detected. Count=$COUNT"
if [ $COUNT -gt $NUM ]; then
echo "Turning off DPMS"
sleep 1 #just in case.
xset dpms force off #force backlight off.
COUNT=0 #reset count
fi
fi
done
-------------------