9

People have asked how to disable the screen from going blank or to sleep, but I have a slightly different question. I would like to be able to remotely wake a sleeping or blank display, but then allow it to go blank again. So far this isn't working.

I've set export DISPLAY=:0 in my .bashrc file and, when the screen goes blank, I run xset s reset over SSH. What I've noticed is that the screen "wakes up", but that it will never go blank again. I'd like to re-enable the default behavior after calling the reset command. Should I just set up the timeout again or is there a different way I should be waking the display? I'm just curious why reset changes the behavior.

GrandAdmiral
  • 603
  • 3
  • 8
  • 16

4 Answers4

9

You have to define which display to use first :

export DISPLAY=:0
xset s reset

Hope this helps

Steve Lng C
  • 191
  • 1
  • 2
  • Is there a reason I can't use those two lines in a shell script? When running only those two lines, I get: ["set: unable to open display ":0] – Bort Sep 24 '16 at 11:30
  • 1
    The bash one liner: DISPLAY=:0 xset s reset – estani Apr 19 '17 at 11:26
4

That's happening because your monitor turns off after 10 minutes as well by default. And even if you reset by xset s reset, screensaver won't be effective as it assumes that your monitor is already off. You can confirm this behaviour by xset q

So solution ? : here : xset s reset && xset dpms force on

This should work effectively.

For more information (and detailed), read xset man entry. man xset and this.

This is probably a very old question (2 years old), but I was trying to achieve the same and stumbled across this. I thought of contributing what I found.

Hope it helps.

dhruvvyas90
  • 2,853
  • 3
  • 19
  • 32
  • @GrandAdmiral - I just confirmed this on my Pi 3 today. This is the best answer. Keep in mind too what Steven Luong C said: use "export DISPLAY=:0" – Bort Sep 25 '16 at 11:57
3

From the man page:

The 'on/off' flags simply turn the screen saver functions on or off. The 'activate' flag forces activation of screen saver even if the screen saver had been turned off. The 'reset' flag forces deactivation of screen saver if it is active.

So reset means deactivate, not reset to default.

M Noit
  • 926
  • 5
  • 7
  • Right, I understand that 'reset' deactivates the screen saver. The problem is that the screen saver never re-activates again. For example: 1. Startx 2. Wait ten minutes and screen saver activates 3. Run 'xset s reset' and screen saver deactivates 4. Wait ten minutes or more 5. Screen saver does not re-activate. I would like to get back to the default behavior of activating the screen saver after running 'xset s reset'. – GrandAdmiral Aug 28 '13 at 14:17
  • xset s reset && xset s activate? – M Noit Aug 29 '13 at 08:38
  • 1
    xset s activate immediately activates the screen saver without any delay. – GrandAdmiral Aug 29 '13 at 13:05
2

The solution of dhruvvyas90 works:

xset s reset && xset dpms force on

but this shorter version also seems to work fine:

xset dpms force on
mvermand
  • 141
  • 5