How to turn off the monitor via command on Wayland (KDE Plasma)?

The accepted answer doesn't answer the question you asked, frankly.
You accepted a shortcut, but your question is - I think - mostly interpreted as looking for a command line solution.

That shorcut works, and your temporary solution in your comment under your question is almost perfect. Here is the command needed:
/bin/sleep 1 && /bin/dbus-send --session --print-reply --dest=org.kde.kglobalaccel /component/org_kde_powerdevil org.kde.kglobalaccel.Component.invokeShortcut string:'Turn Off Screen'

Basically, the difference compared to your solution:

  • don't use qdbus command as it is deprecated (good distos ship it with some qt4 tool package still, but only with them, and they do not install it by default. Nor should most people install it...)
  • you almost got the dbus method call right, but used a wrong shortcut and a hack with power button. It needed 2 minutes more in D-Bus viewer to find "Turn Off Screen" argument for invokeShortcut

And why would anyone need a command if there is a shortcut? Because some people need a command for turning off screen together with screen locking

Anyway, thank for your answer, as it helped me a lot find the solution to this, and the latter question!!!


It was recently added as a native KDE Keyboard Shortcut option which also works for Wayland. It is roughly located at System Settings -> Shortcuts -> Power Management -> Turn Monitor off