0

I want make som scripts to lock(mute,screen off,lock)/unlock(unmute,screen on,unlock) session, and I want execute it with hotkeys.

I have script for lock Windows and Linux. And I need scripts to ulock sessions locked with password.

I know in Windows it must be Service: http://msdn.microsoft.com/en-us/library/ms686953%28VS.85%29.aspx What to call in my service to login with password?

And what is the way to do unlock Linux session?

Thanks for reply.

1
  • To make this question clear, you would need to specify which distribution of Linux you are running and whether you are using the default window manager or have installed your own (if you don't know what a window manager is, you are using the default, but please specify that).
    – ShankarG
    Commented Mar 22, 2012 at 6:39

1 Answer 1

0

If you are using any of the major distributions and if you are using GNOME or KDE, there are graphical interfaces that will allow you to specify hotkeys for this. If not, or if you want a generic solution, most distributions come with the xlock command. You can then write a short script like this

#!/bin/bash
amixer sset Master mute
xlock

Save this script somewhere in your PATH (if you don't know what that is, look at this intro page on it) and make it executable with the command chmod a+x <script name>.

Then, you'll have to set a hot key that will execute this script in your window manager, but that will depend on which one you're using. To find out more you can just Google your distribution or window manager's name along with the words "key bindings" or "hot keys" and you're likely to find instructions.

Unlocking from xlock is just a question of moving your mouse or pressing any key, and then entering your password.

If you want a different screensaver, run man xlock and look at the various options.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .