Hi everyone, I’m running KDE Plasma 6 with Wayland and I’m trying to find a way to turn on the screen programmatically via the command line. In X11, I could use xset dpms force on, but this doesn’t work in Wayland due to its security model. Has anyone found a reliable method to wake or turn on the screen from the command line in a Wayland session? I’m aware of the security and architectural reasons behind this limitation, but I’m curious if there are any workarounds, compositor-specific DBus calls, or third-party tools that might help. What I’ve tried so far: xset dpms force on (fails, as expected)

Simulating keyboard input with wtype/ydotool (unreliable)

Checking KWin’s DBus interface (no obvious method exposed)

Context: I’m automating some tasks and would like to avoid switching back to X11 just for this feature. Any insights, scripts, or suggestions would be greatly appreciated! Thanks in advance for your help.

    • Blackbeard@europe.pubOP
      link
      fedilink
      arrow-up
      1
      ·
      1 day ago

      This works!

      Key Commands

      1. List Connected Displays To see all connected outputs and their status:

      kscreen-doctor -o

      Example output:

      Output: 1 eDP-1
              enabled
              connected
              Modes: 1:2560x1600@60.00*!
      

      This helps identify your display names (e.g., eDP-1 or HDMI-A-1).

      1. Turn Off All Displays (DPMS) To put all displays into low-power mode:

      kscreen-doctor --dpms off

      Uses DPMS (Display Power Management Signaling) to turn off displays safely.

      1. Turn On All Displays To wake all displays:

      kscreen-doctor --dpms on

      1. Disable/Enable a Specific Output To control a specific display (e.g., HDMI-A-1):
      kscreen-doctor output.HDMI-A-1.disable
      kscreen-doctor output.HDMI-A-1.enable
      

      Note: Avoid disabling your primary/laptop panel (e.g., eDP-1) unless you have another display connected.

      1. Bonus: Adjust Brightness or Scale
      kscreen-doctor output.eDP-1.brightness.50  # 0-100
      kscreen-doctor output.eDP-1.scale.1.5     # Scale factor