Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: What to call in my service to login with password?

And what is the way to do unlock Linux session?

Thanks for reply.

share|improve this question
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 Mar 22 '12 at 6:39

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

amixer sset Master mute

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.

share|improve this answer

You must log in to answer this question.

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