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

Comments

Unknown 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 :]
Anonymous said…
I ADAMS KEVIN, a representative of Aiico Insurance plc, we trust and respect for individual differences in day out a loan. We will provide 2% of the loan's interest rate. If you are interested in this business contact us by e-mail (adams.credi@gmail.com) now transfer their loan documents issued properly. Do you need a loan to set up business or school if you are very welcom to aiico insurance plc.you can also contact us by email(aiicco_insuranceplc@yahoo.com) we first week can request a balance transfer.

व्यक्तिगत व्यवसायका लागि ऋण चाहिन्छ? तपाईं आफ्नो इमेल संपर्क भने उपरोक्त तुरुन्तै आफ्नो ऋण स्थानान्तरण प्रक्रिया गर्न
ठीक।

Popular posts from this blog

How to make your window Full Screen in gnome?

A simple mjpeg streamer for python

HashMap loop in java