Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I lock screen, the display does turn black but the display isn't completely off. There is some light coming out of the display in screen lock mode but it get turned off when inactive for 10 minutes as configured from Brightness and Lock setting.

I tried xset dpms force off which completely turn off the display.

Is there any way that when I press Ctrl + Alt + L to lock screen, the screen get locked and the display is completely turned off saving some power.

share|improve this question

6 Answers 6

up vote 6 down vote accepted
  1. Go to System Settings --> Keyboard --> Shortcuts,
  2. Create a new Custom Shortcut.
  3. Reassign Ctrl + Alt + L to the following command.

    bash -c "xset dpms force off; gnome-screensaver-command -l"
    
share|improve this answer

I am running a script for same problem (source):

#!/bin/bash
sleep 0.5
xset dpms force off
gnome-screensaver-command -l 

This turns monitor off and locks the session. The sleep 0.5 is there to avoid the monitor turning on when you release the Ctrl+Alt keys; maybe you don't need this.

You can try other solution also from there (didn't tried this one yet).

The solution I use is:

  1. I have added the Inhibit Applet to my top panel (this lets me toggle the sleep mode off and on)

  2. In power management I set Put display to sleep when inactive for: 1 minute.

  3. I use the Ctrl+Alt+L (I actually changed my shortcut to Ctrl+Alt+Spacebar) to lock the screen.

So when I am using the laptop the first thing I do is click on my Inhibit Applet in my top panel so my display does not go to sleep in 1 minute of inactivity.

When I am all done and want to lock the screen and turn off the monitor I click on the Inhibit Applet so it allows the sleep timer to work, and I hit my combination of keys to lock the screen Ctrl+Alt+L.

The Screen is locked and in 1 minute the display turns itself off.

share|improve this answer
    
sleep was required for me –  geekQ Apr 18 '13 at 11:32

Go to System settings > Keyboard > Shortcuts > new Custom shortcut and set command to:

bash -c "xset dpms force off; gnome-screensaver-command -l"

Then set a key combination, for example, ctrl + escape.

It worked on my desktop, but didn't work without the above bash command.

share|improve this answer

I have tried this:

xset dpms force off && gnome-screensaver-command --lock && sleep 10

And it turns off display. Now make file called .turnScreenOff.pl and write this in that file, like using gedit ~/.turnScreenOff.pl

#!/usr/bin/perl

`xset dpms force off && gnome-screensaver-command --lock && sleep 10`;

After that, go to terminal (to open Ctrl+Alt+T) and write in:

chmod +x .turnScreenOff.pl

Now what we will do: is just change lock screen command


first step
To disable use Backspace. Than move on to Custom shuortcuts
second
Set name something like turn screen off and lock screen and set command to perl ~/.turnScreenOff.pl
third
And now select that and press buttons you want to set shortcut to, e.g. Ctrl+Alt+L or whatever you want :-)

Hope this helped.


Result!

share|improve this answer
    
Thank You, but the method I used seems very easy for me. –  TheKojuEffect Jan 29 '13 at 13:56
    
you're welcome :-] –  geoh Jan 29 '13 at 13:58

I found help here.

  1. Go to System settings --> Keyboard --> Shortcuts and create a new custom shortcut.
  2. Enter as command: gnome-screensaver-command --lock xset dpms force off
  3. Set as key combination: Str + Alt + L to replace the default lock screen shortcut.

Works with my Lenovo R400, so please try it.

share|improve this answer

Command that worked for me :

#!/usr/bin/perl
`gnome-screensaver-command --lock && sleep 5 && xset dpms force off `;

Somehow the lock command was switching on the screen back. Also the sleep was needed to fire the screen off after a delay.

share|improve this answer

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.