KDE-Improve Your Lock Screen Button!
Written by Matt on February 17, 2008 – 9:36 am -
Most Linux users will probably admit to having a “Lock Screen” button. Why? Because it is very useful to be able to slide your pointer to the top right of your screen and click a button before stepping out of the room for a few moments. Although both KDE and Gnome have an “applet” for locking the screen, creating a custom one will be more efficient. Even when you lock the screen, the monitor still stays on, and probably will for at least a few hours. By creating your own button, you can turn off your monitor and lock the screen at the exact same time! Right click one of your panels, click on Add Application to Panel–>Add Non-KDE Application. Add whatever Button title, Icon, and Description, but for the Executable, place this:
sleep 1 && xset dpms force off && kdesktop_lock -forcelock
Posted in KDE |
View blog reactions

February 17th, 2008 at 9:53 am
WOW, nice tip!!! Works a treat. :D
February 18th, 2008 at 12:03 am
Hmmm…so the “sleep 1″ is there to make sure you’ve stopped moving your mouse before putting the screen to sleep. Great idea but here’s my 2-cent patch:
kdesktop_lock -forcelock &This makes sure you can confirm that your screen locked and that it won’t fail to lock just because xset decides to have a hiccup.
February 18th, 2008 at 12:04 am
Okay…my code got butchered…let’s try this again:
kdesktop_lock -forcelock \&\& \{ sleep 5\; xset dpms force off\; \}
February 18th, 2008 at 12:05 am
Just ignore the slashes above ;- )