8

I recently installed a program on my Ubuntu 20.04 machine that needs Wayland instead of X11 to work. I also frequently used the command xset dpms force off to turn of my display. However, this command does not work in Wayland and gives the error message : server does not have extension for dpms option. Is there a way to turn off the display in wayland ?

1 Answers1

5

In Wayland (and Xorg), you can activate the screensaver if that is set to blank the screen:

dbus-send --session --dest=org.gnome.ScreenSaver --type=method_call \
          /org/gnome/ScreenSaver org.gnome.ScreenSaver.SetActive boolean:true
vanadium
  • 88,010
  • 3
    This does not help me. On my recently upgraded system the screen blanks (screensaver) but the backlight of my laptop stays on. At night this lights up the whole room. "dpms force off" used to turn off the backlight. – rew Aug 15 '22 at 12:05
  • 3
    I would not consider activating the "screensaver" as a workaround to forcing DPMS OFF. These are different features that don't do the same thing. DPMS OFF means the monitor goes in energy saving mode and completely turns off all of its pixels and backlight. SCREENSAVER blank means the monitor remains operational but only the backlight (on LCDs here) stays on. I do not have an answer for the OP as I am also looking for one. – Frank Jun 14 '22 at 23:03
  • Works well on my Ubuntu 23.04 desktop system, with an NVIDIA GPU GeForce RTX 2070 (using the open source xserver-xorg-video-nouveau driver) and three LG 27UD58-B displays. After running the command, the lock screen is briefly visible, then the monitors go into power saving mode (showing "no signal detected", then they "turn off"). Clicking the keyboard restores everything, as expected. While I've certainly tweaked some power settings to my liking, it's only been "the usual" via the settings GUI. – Joel Purra Jun 07 '23 at 12:09