[mythtv-users] How to get rid of power save

Alan Snyder ax763 at yahoo.com
Fri Jan 30 15:58:17 EST 2004


Here's the script I use on our kitchen machine that's sometimes a TV and
sometimes a desktop.  It's linked in ~/.kde/Autostart

#!/bin/bash
while true; do
if [[ `top -b -d 1 -n 3 | grep mythfrontend | awk -f ~/max.awk` == "1" ]]
        then
                xset -dpms s off
        else
                xset dpms 0 600 0 s off
fi
sleep 60
done

where max.awk is

BEGIN {
total=0.0
}

{ total=total+$9 }

END {
if (total>30) { print 1 } else { print 0 }
}


So if mythfrontend is using more than 10% CPU (noticing that top runs 3
times) then the screen power controls are disabled; otherwise there's a
10-minute timeout.



More information about the mythtv-users mailing list