Is there a terminal command?

For istance, when i type:

sleep 1 && xset dpms force off

It turns off the display but enables automatically the screenlock (that instead I'd like to keep just when the computer is inactive).

2 Answers 2


xset dpms force off
Also disable "Lock after screen turns off" in System Settings > Security & Privacy > Locking.

  • When I run that command then the screen automatically locks but if I disable "Lock after screen turns off" I would lose the locking during inactive mode May 22, 2017 at 19:41
  • Then don't disable "Lock on sleep", also in System Settings > Security & Privacy > Locking. May 22, 2017 at 20:38
  • Yeah I don't disable it, for inactive I mean that the screen turns off after some minutes and locks automatically May 22, 2017 at 20:45
  • Set the minutes after you want to turn off display and lock automatically in System Settings > Power. May 22, 2017 at 21:00
  • No, I explain better. I'd like write a command in terminal so that just the screen turns off immediately (ex. in a moment I'm studying on paper) and when I move/click the mouse it turns on. I prefer a command so that the screen turns off and locks automatically just in case I'm too long time far from the computer (so I can't set too few minutes). From the other answer it seems that I have a kind of bug that I don't know how to solve. May 22, 2017 at 21:16

Actually, the lowest brightness level on elementary turns off the display. This question covers how to change brightness using command line.

  • I tried both methods with brightness to 0 but it just decreases to zero the brightness leaving the screen turned on May 22, 2017 at 19:46
  • That might be a bug in your system. Not only elementary turns off display for the lowest brightness, but also Ubuntu and most, if not all its derivatives. Have you tried the lowest brightness using GUI? Does it turn off display? May 22, 2017 at 19:59
  • Do you mean with xrandr? It decreases the brightness to 0 doesn't turn off the screen May 22, 2017 at 20:06
  • No. I mean with using your mouse or keyboard with the brightness slider like so i.stack.imgur.com/ZHRQG.png May 22, 2017 at 20:10
  • Sorry, no it doesn't work (and also doesn't reach the 0 brightness like the other methods) May 22, 2017 at 20:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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