Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I’m using a Debian amd64 install with the default GNOME desktop. I’m aware that you can go into System | Preferences | Power Management, and choose to make the display go to sleep after a certain period of inactivity. However, I currently have that set to ‘Never’ because until I lock the screen, I don’t want the display to go to sleep. Once I lock the screen, though, I want it to go to sleep immediately unless/until it detects activity, or at least go to sleep after 1 minute or something. Is there a way I can configure it to do this only when I ‘Lock Screen’?

share|improve this question
add comment

1 Answer

You could run a script:

#!/bin/bash
gnome-screensaver-command --lock
xset dpms force off

Bind this to a key sequence and whenever you lock your screen, the display will turn off.

share|improve this answer
    
Hmm, would there be a way to get such a script to run when the default ctrl-alt-L key sequence is pressed; or even when you select the 'lock screen' GNOME menu option? –  Jez Jul 5 '11 at 10:24
    
In your Keyboard Preferences, change Lock to something else (eg., Ctrl-Shift-L) and map Ctrl-Alt-L to the script. You could edit the Menu entry the same way... –  jasonwryan Jul 5 '11 at 10:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.