11

Seems like GNOME updated to Wayland which caused a few issues, the biggest is the periodic crash that brings you back to the login screen. Another issue that is hopefully easier to fix is that I can no longer put my display to sleep.

Before the update I was using this sh script bound to a shortcut:

sleep 1; xset dpms force off

After it produces the error below:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  147 (DPMS)
  Minor opcode of failed request:  6 (DPMSForceLevel)
  Serial number of failed request:  12
  Current serial number in output stream:  14

What is the correct way to put the display to sleep manually with Wayland?

Edit:

It appears that the DPMS does not work properly which is the reason for the error.

Check DPMS status:

xset -q

Result:

DPMS (Energy Star):
Display is not capable of DPMS

xset +dpms command does not enable it. It was working before the Gnome update so DPMS was supported. What could be the issue here?

DominicM
  • 659
  • 2
  • 15
  • 26
  • You must not expect Wayland to provide all the non-graphical facilities of X11. I dont know what might replace dpms, but your system probably still provides you a gnome on X11 alternative. Look for it. – meuh Oct 17 '16 at 15:12
  • @meuh From what I can find DPMS should be working fine with Wayland. – DominicM Oct 17 '16 at 16:48
  • I read that the component that should handle this part is the "Compositor". The Wayland compositor for Gnome is named "Mutter". I found this: `busctl --user set-property org.gnome.Mutter.DisplayConfig /org/gnome/Mutter/DisplayConfig org.gnome.Mutter.DisplayConfig PowerSaveMode i <0-3>` values ar at the bottom of https://wiki.gnome.org/Initiatives/Wayland/Gaps/DisplayConfig but it turnsoff the screen immediately :( – exeral Jan 02 '17 at 15:18
  • 1
    I went back to using x11 so cant test this but if it turns off the display isn't that what the goal is? – DominicM Jan 02 '17 at 17:52
  • I tried using `busctl` to change `PowerSaveMode` to 3, and it does turn the screen off for me, but unlike `xset dpms force off`, moving the mouse or typing on the keyboard does not turn the screen back on. The documentation @exeral links to makes it sound like we shouldn't be using this, with sentences like "the actual effects of the different values depend on the hardware and the kernel driver in use" and it "may or may not" do certain things, as well as saying the "interface is considered semi-private and may change in the future." – paulie4 Jan 12 '17 at 05:29
  • 1
    Good to know, I guess I still can't use Wayland. – DominicM Jan 12 '17 at 10:22
  • I found a reddit discussion about this. In it, they suggest the following (see https://www.reddit.com/r/linux4noobs/comments/5cg8ck/turning_off_the_display_in_gnome_in_wayland/): `busctl --user call org.gnome.Shell /org/gnome/ScreenSaver org.gnome.ScreenSaver SetActive b true` – paulie4 Mar 06 '17 at 04:46
  • Unfortunately it leaves the lock screen active after screen wakes up so not the same functionally. The other example might work for me as I bind a script to a key. It's better in some ways as the screen won't wake up from anything except a specific shortcut. Will test it out, and report back. – DominicM Mar 06 '17 at 09:37

1 Answers1

11

So this here works for GNOME 3.24 Wayland:

put all displays in standby:

busctl --user set-property org.gnome.Mutter.DisplayConfig /org/gnome/Mutter/DisplayConfig org.gnome.Mutter.DisplayConfig PowerSaveMode i 1

Resume all displays:

busctl --user set-property org.gnome.Mutter.DisplayConfig /org/gnome/Mutter/DisplayConfig org.gnome.Mutter.DisplayConfig PowerSaveMode i 0

The command can be given over ssh, just in case ;) There does not seem to be a screen lock.

The GNOMErs decided to have gdm run a separate GNOME X session for screen lock, leading to a host of bugs and problems like what session is shown, what session is locked, what session has the keyboard. This is why blanking and screen lock are absent from the Wayland session.

It seems the World has yet to see a screen lock for Wayland.

user229115
  • 211
  • 2
  • 4
  • 1
    Debian Buster same issue. Problem is that even using busctl it wakes up after a few seconds again. This is crazy. All new 2018 HW and I cant keep my display blanked. – RichieHH Dec 18 '18 at 10:40
  • Is there an equivalent command for plasma desktop? – sedrubal Aug 20 '21 at 16:17