1

I want to use a keyboard short cut to manually turn the screen off.

This answer reduces the brightness but doesn't turn the screen off.

This answer does what I want if launched from the terminal, but when used as a keyboard short-cut, the screen off only lasts 1 second (and the screen comes on after one second). The same problem occurs with xset dpms force standby.

For some reason, I can't get This answer to work (it just doesn't do anything).

(the computer is a laptop and I want the monitor to come back alive if either the mouse is moved or any key pressed, as in This answer).

user2413
  • 14,957

1 Answers1

1

I suspect the screen comes back on is because you've just fired a keyboard event. It works on my computer but that could be explained by event timing, bus types, who knows.

Anyway, try giving it a bit of lead time for any X events to seep away:

sleep 1 && xset dpms force standby
Oli
  • 299,380