1

Under Waayland I used busctl --user set-property org.gnome.Mutter.DisplayConfig /org/gnome/Mutter/DisplayConfig org.gnome.Mutter.DisplayConfig PowerSaveMode off to turn off / on the display however after having to go back to X11 due to Wayland being unusable this command works same as dpms force off.

With X11 I can run sleep 1; xset dpms force off but this only puts the monitor into standby and will wake as soon as any input is detected such as mouse moves. This is unwanted behaviors and I prefer the ability to wake the display with a specific shortcut. This way I can be sure the display won't turn on on it's own or accidentally.

So, how do I force the display to turn off in such a way as to prevent user input from waking it again under X11?

4
  • Try xrandr --output your_output_name --off. xrandr by itself to list outputs.
    – dirkt
    May 9, 2017 at 13:11
  • @dirkt xandr command crashes the desktop completely and doesn't work anyways. Doesn't it just call dpms force off anyways?
    – DominicM
    May 10, 2017 at 12:16
  • 1
    So it's a single screen, not one extra screen you want to turn off, and you don't really want to turn it off completely, you want DPMS "off" mode? Then xset dpms force off is the right command, but the X server will switch the mode to on again as soon as it detects input. I don't think you can disable that, you'll probably need to patch the X server, or grab all input sources with evtest --grab /dev/input/eventX so they don't get read by the X server, or something like that.
    – dirkt
    May 10, 2017 at 13:06
  • @dirkt yes, I just want it off completely. So why does the busctl command above work differently on X11 compared to Wayland? It sounds like a bug but which is the expected behaviour?
    – DominicM
    May 10, 2017 at 22:30

1 Answer 1

1

I think you possibly misunderstand what DPMS "off" means. Look at the table in Wikipedia, what DPMS actually does is to signal the power saving state by turning the horizontal sync and vertical sync signals (or the HDMI equivalent) off, and disabling the DAC in the graphics card, while the rest of the graphics card keeps running. So you are not turning everything completely off, you are entering the "deepest" power saving mode possible.

OTOH, using xrandr --off really completely shuts off the output, and disables everything in the graphics card that is used to produce the output, as if the monitor was not connected to anything at all. And of course, if it is your only monitor, this doesn't work, as then there is no more graphics display to draw anything on. This is really for enabling and disabling additional second or third monitors.

So you don't want it "completely off", you want the deepest DPMS power saving state which happens to be called "off".

Your busctl command tells Wayland to use PowerSaveMode, i.e. DPMS. And Wayland doesn't seem to re-enable DPMS when it detects mouse or keyboard inputs, so it stays off.

In the same way, xset dpms tells the X server to use DPMS. This is completely the same thing. The difference is that the X server re-enables DPMS when it detects inputs.

As to "why", it's how the developers decided how it should work. In X, xset dpms works even when there is not extra screensaver, which is why the way to turn the screen on again was incorporated in the X server. For Wayland, the designers seem to have decided that you always need an extra screensaver program (whose job it is to communicate the wanted PowerSaveMode to Wayland), so it leaves it to the screen saver to monitor inputs and turn the screen on again. That you are able to fake being a screensaver program using busctl is more or less an accident.

It's not a bug, it's different design.

As I said, try grabbing the mouse and keyboard inputs with evtest --grab /dev/input/eventX (use just evtest to see which device is which. Careful, numbers don't need stay the same across boots, look at the udev symlinks) or the equivalent ioctl if you are writing your own screensaver program. If you want to monitor the inputs for a specific combination, you need to do that anyway.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .