This could be achieved with X easily, but although looking extensively on AskUbuntu and other sites, I did not find a solution for Wayland :-(
The closest I came to was the command kscreen-doctor --dpms off
. Unfortunately this turns off all monitors at once. But I'm looking for a more granular command that can turn on/off a single monitor alone.
Some posts suggest that this depends on the compositor. So I checked which compositor Kubuntu 24.10 uses with inxi -Gxx | grep compositor
and the output is:
compositor: kwin_wayland driver: X: loaded: modesetting unloaded: fbdev,vesa
But what command or command-line-tool can I use to achieve the given task?
As suggested in the comments, this can be achieved with the command line utility
ddcutil
. Install it withand then enumerate your monitors with
The output contains a sequential monitor number like
Display 1
, a bus address like/dev/i2c-2
and a serial number like1138753042236
besides other information like the name of the manufacturer and so on.Each of these values can be used to address the monitor whose state you like to change. To turn a monitor on, pass the value
1
to the VCP0xD6
, and to turn it off, pass the value2
respectively. So specify the monitor and then the value for ON/OFF.For example, to turn off display/monitor 1 by sequential number, use
And to turn it off by serial number to make it independent of enumeration, use
and to turn it on again
There are a lot of other options that can be configured this way, but turning a monitor on and off is the most basic option.