Sunday, June 29, 2008

Locking screen from command line

I use gnome and so far I've been happy with my Ctrl+Alt+L shortcut in gnome. It used to lock up the screen when I was away from the desktop. However, recently, I've started to use XFCE and sometimes ratpoison, which didn't have this shortcut.
Anyways, the simpler way to lock your screen is from command line and it seems to work everywhere I've tried so far.

$xscreensaver-command -lock
I just kept in here so that I don't forget. Maybe this little tip would be useful for some.

I just found an alternate method that can work too.
$gnome-screensaver
$gnome-screensaver-command -l

1 comments:

Markizano Draconus said...

I know this post is a few years old, but when searching "gnome screensaver lock command line", this post comes up as the first result. Thanks much for putting it out there for us Googlers :]