Hidden Linux : Monitor switch-off

My LCD monitor's tricky to switch on and off. Not only is its power button in an odd place, but it's also small, unlit, and flush-mounted. That means I invariably hit Brightness or Menu when I'm head away from my desk for an extended period. But, no worries. Linux to the rescue...
The manual page for xset describes it modestly as the "user preference utility for X", and one of those preferences is monitor control.
| xset q |
| xset dpms force off |
So by creating a keyboard shortcut to perform the command
| sleep 1 && xset dpms force off |
you can create a keyboard-based, power-saving, monitor switch. (Moving the mouse or hitting a key will reawaken it.)
In case you're wondering, sleep 1 forces the system to wait a second before executing xset. Keyboards send signals when keys are pressed and released, so without it the monitor would only switch off for as long as you held the key down!
<--Previous Hidden Linux Next Hidden Linux -->

PC World is New Zealand’s top selling computing and technology magazine.
Comments
Thank you for the information.
it helped me.
Posted by: Anonymous | November 8, 2011 12:04 AM
Thanks you so much! Just what i was looking for. Much appreciated.
Cheers!
Posted by: Anonymous | September 14, 2011 8:56 AM
This is legendary. Thanks.
Posted by: Jordan | October 9, 2009 2:51 PM
Thank you very much for this information! It is very useful for me.
Posted by: macias | March 2, 2009 6:31 AM
Thank you! I've been trying to do this for a long time.
Posted by: Gregory | February 28, 2008 10:08 AM