Sunday, March 29, 2009

sleeping your computer

Sounds easy, right? You go into Power Management and set it to sleep after 30 mins. Done deal. Well what if you've enable fast user switching? Now all-of-a-sudden your computer goes to sleep because your wife is idle on VT8 while you are active on VT7. Dammit!

Here is a work-around: don't use X to sleep the computer. Disable sleep for each profile, then:
apt-get install sleepd
edit /etc/default/sleepd
mine looks like:
PARAMS="-U 1800 -u 1800 -i 22 -i 23 -s \"s2ram -f\""

The default is to hibernate which is silly for a diskless desktop, so I s2ram instead. The interrupts to watch can be discovered by:

watch -n1 cat /proc/interrupts

Now wiggle the mouse and hit keys on the keyboard to discover which interrupts increment when you do that.