Lock your screen using command line

Hi friends,
I read one article today and that was fantastic.I am sharing that article here hope you all like it.

Lock your Screen using command line in Fedora 10 and Ubuntu.

This command is extraordinary for who work on terminal continuously and want to step away for some movements.

gnome-screensaver-command –lock

NOTE –In this command, where you see “–lock”, it is really 2 hyphens with no spaces in between, followed by “lock” …  - – lock. WordPress renders two hyphens put together as… –

When you execute above command then it will activate your screen saver and prompt for password to login.But as i metioned that command is pretty long so you need to create alias for that.To create alias Follow below method.

Open your .bashrc file into your favorite editor i am using vim as my editor.before editing file dont forget to make backup.
vim .bashrc (if you are not at home directory prompt then vim /home/<user-name>/.bashrc)

Now just move to end of file and paste below content.
alias lock=’gnome-screensaver-command –lock’

Save & Exit from File.

Now above commands tells your ubuntu or fedora that if you type in lock ,it actually executes gnome-screensaver-command –lock

Enjoy Lock Screen from Command Prompt :)

source :- http://howto-ubuntu.com/2008/12/11/how-to-lock-your-screen-from-the-command-line/
VN:F [1.8.1_1037]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.1_1037]
Rating: 0 (from 0 votes)

  • Share/Bookmark

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

5 Comments »

 
  • GlenStef says:

    Everything dynamic and very positively! :)
    Thank you
    GlenStef

    UN:F [1.8.1_1037]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.1_1037]
    Rating: 0 (from 0 votes)
  • Encactino says:

    mm. love it.

    UN:F [1.8.1_1037]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.1_1037]
    Rating: 0 (from 0 votes)
  • Hi, interesting post. I have been wondering about this topic,so thanks for writing. I will certainly be subscribing to your blog. Keep up the good work

    UN:F [1.8.1_1037]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.1_1037]
    Rating: 0 (from 0 votes)
  • KS Solanki says:

    i have to lock screen for root ….how can i do that ….plz tell me some solution.

    UN:F [1.8.1_1037]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.1_1037]
    Rating: 0 (from 0 votes)
  • Tejas Barot says:

    Which Distribution you are using? If you are using Fedora then install xlock package by following yum -y install xlockmore* and execute xlock command to lock your root screen. I hope its available for Ubuntu also. But I didnt tried this in ubuntu

    Enjoy. :)

    UN:F [1.8.1_1037]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.1_1037]
    Rating: 0 (from 0 votes)
 

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>