How to turn off primary display in Wayland?

I have monitor plugged in to my laptop, but sometime when I reading something I want to quickly turn off the primary monitory in order to reduce distractions. Currently I do this by going to settings.

But I want to do it from the command line, while in X11 this could done using xset not sure how to do the same in Wayland.

Using xrandr like xrandr --output XWAYLAND3 --off throws following error

 X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  7 (RRSetScreenSize)
  Serial number of failed request:  28
  Current serial number in output stream:  29
2 Likes

The error is because xrandr is xorg only and does not work with wayland.
I do not know an equivalent for wayland.

Try key press Meta+p and then select external monitor only. ( Meta key /windows key)
You can switch from laptop screen to external monitor easily without doing any permanent configuration. If you disconnect the external monitor it will switch back to Laptop screen.

4 Likes

Thanks a lot mate!