Tech Tip: Go Green On Your Screen(saver)
I usually lock my screen when I leave my cubicle for a tea-break etc. With all the talk of saving energy these days I've disabled screen-savers on my system. Still, when I'd lock my screen I noticed that the LCD didn't turn off completely. Wanting to go as green as I could I wanted to switch off the LCD as well.
The following command does that:
xset dpms force off
When I press "Alt+Ctrl+L" (lock screen), the following command is invoked:
gnome-screensaver-command --lock
What I want now is to associate the following command with a different shortcut key:
gnome-screensaver-command --lock; xset dpms force off
So that I can lock as well as power off my LCD screen with a keyboard shortcut. To do this I installed xbindkeys to add a custom shortcut key. When you have xbindkeys installed create created the default config file:
xbindkeys --defaults > /home/your-user-name/.xbindkeysrc
Now assign a shortcut key. To do this you edit the config file (or if you prefer you can install xbindkeys-config) and append the following lines to the file:
# lock&blank "gnome-screensaver-command --lock; sleep 1; xset dpms force off;" alt+control+k
You also should remove all the enabled lines (comment them out), at least in my case they somehow interfered with my other shortcuts. I also had to add the sleep 1 between the commands to get it to work, perhaps due to compiz animation time.
Now, when I press "alt+control+k" I save power as well as lock my screen.
Tested on Ubuntu 8.10 running on Lenovo T61p.
__________________________Submitted by Sangeeth Keeriyadath on Tue, 2009-10-20 11:33.

Delicious
Digg
StumbleUpon
Reddit
Facebook
Why do screen(savers) don't really save ?
1. They consume more power than a switched off display(the calculation for this is pretty simple :) )
__________________________2. screensavers do consume some amount of CPU cycles.
3. Keeping the display switched on continuously may reduce it's lifetime.
Sangeeth Keeriyadath
www.sangeek.com
KDE
For KDE do:
__________________________Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.
> For KDE do: > dcop
> For KDE do:
> dcop kdesktop KScreensaverIface lock
> sleep 1
> xset dpms force off
NOOO
Since years ago KDE uses D-Bus, so it should be:
qdbus org.kde.krunner /ScreenSaver org.freedesktop.ScreenSaver.Lock; sleep 2s; xset dpms force offSee more in:
http://foss-boss.blogspot.com/2008/11/ride-d-bus-control-your-linux-desktop.html
Depends on which version of KDE you're using
If you're using KDE4 then yes, use dbus. If you're using KDE3, which I am, then no, use dcop. I should have mentioned that this was for KDE3.
__________________________Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.
works in XFCE too
Very neat. I also used the xscreensaver-command -lock;sleep 1;xset dpms force off, saving it into a text file, making it executable, and then configuring that as
a hot-key under XFCE (used linux-key + L). and blow me down, it worked.
Thanks
I just plugged my lcd's into
I just plugged my lcd's into a powerstrip on the desktop. and then jut hit that button. :)
May need to disable gnome-power-manager's backlight handling
Because the current gnome-power-manager's backlight control is completely broken, you may need to disable it by setting /apps/gnome-power-manager/backlight/enable to false in gconf-editor. At least on my laptop gpm kept turning the backlight back on after a minute or so after running
xset dpms force off.You just need to set
You just need to set /apps/gnome-power-manager/backlight/idle_brightness to 0. I tested it and works so far. :)
No i'm wrong.. :(
No i'm wrong.. :(
it works with xscreensaver too
the same tip can also be done if you use xscreensaver instead of gnome's
even doing
$xscreensaver-command -lock; sleep 1; xset dpms force offin a terminal worksI also was looking for a way to turn off my laptop's screen so thanks for the tip :)
You can assign the shortcut
You can assign the shortcut key using "Commands" in CompizConfig Settings Manager (in Gnome).
Post new comment