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.

  • Hominine@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    21 hours ago

    screen_off = “qdbus org.kde.kglobalaccel /component/org_kde_powerdevil invokeShortcut ‘Turn Off Screen’” I use this on deck and the following on desktop where the monitors automatically shut off: “kscreen-doctor output.DP-2.disable” hope it helps!

  • gartheom@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    17 hours ago

    I use this in a cronjob to turn a raspberry pi screen off at night and back on in the morning:

    wlr-randr --output "HDMI-A-1" --off

    wlr-randr --output "HDMI-A-1" --on

    I’ve also go this environment variable set but I don’t know if it is needed outside of cron:

    XDG_RUNTIME_DIR=/run/user/1000

  • lambalicious@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    22
    ·
    20 hours ago

    Hahahaha! Wayland sucks so much you users can’t even turn the screen on or off.

    Welp, time to return to physical switches I guess!

    • guynamedzero@piefed.zeromedia.vip
      link
      fedilink
      English
      arrow-up
      8
      arrow-down
      1
      ·
      18 hours ago

      Did you read anything other than half of the words in the title? If you’re a troll, please, stop, we don’t need more separation of communities in this world. If you’re not a troll and genuinely this stupid: get off the internet, go to your local library and just read any nonfictional book, that should give you some insight on how things actually work in the real world.