I am using Kubuntu 23.04 with Wayland.
I found this answer, which works in two other computers running (Kubuntu 22.04 and Ubuntu MATE 22.04) X.Org, but this does not seem to work in my Wayland computer.
$ echo "$DISPLAY"
:1
$xset -display :1 dpms force off
server does not have extension for dpms option
xset: unknown option force
How to turn display on and off using the command line, when the display manager is Wayland?
sudo systemctl restart lightdm. – Rishon_JR May 06 '23 at 06:19sudo systemctl restart sddm. Try this answer if you want your computer to go to sleep. – Rishon_JR May 06 '23 at 06:30swayidle? – nobody May 06 '23 at 08:24:0.0... You can check withecho "$DISPLAY". – Raffa May 06 '23 at 09:04:1. Now there is a new error. I have edited the question. – Archisman Panigrahi May 06 '23 at 14:29xsetis ever going to work for you on Wayland, it would be without the power management option ... So, try justxset s off– Raffa May 06 '23 at 14:54xset s onorxset s blank... it's the screen saver mode ... should be blank screen by default ... Then, activate it withsleep 2 && xset s activate... Thesleepcall is necessary before the command. – Raffa May 06 '23 at 15:18xset s blank && sleep 2 && xset s activateseems to do nothing. – Archisman Panigrahi May 06 '23 at 15:46