You are not logged in.

#1 2023-03-12 11:18:28

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

[Solved] How to disable monitor in Sway/Wayland?

Dear all smile

If I do this in Sway

bindsym $mod+m exec wlr-randr --output HDMI-A-2 --on && wlr-randr --output eDP-1 --off
bindsym $mod+Shift+m exec  wlr-randr --output eDP-1 --on && wlr-randr --output HDMI-A-2 --off

then it turns the desired monitor off, but doesn't disable/remove it. I can see this as the mouse can continue into nothing when I move it to the right border. Here I would have expected it to meet a hard border, so the pointer also is on the screen.

Does anyone know how to remove/disable a monitor in Sway?

Hugs,
Sandra smile

Last edited by LittleSandra (2023-03-13 07:38:27)

Offline

#2 2023-03-12 21:56:29

szlig
Member
Registered: 2023-03-12
Posts: 1

Re: [Solved] How to disable monitor in Sway/Wayland?

Hi Sandra,

is there a reason why you use wlr-randr?

You can use this:

bindsym $mod+m output "HDMI-A-2" enable ; output "eDP-1" disable

Or you can use toggle instead of enable/disable, so you don't have to use different shortcuts. More information about this in the sway-output manpage.

Offline

#3 2023-03-13 07:38:08

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

Re: [Solved] How to disable monitor in Sway/Wayland?

szlig wrote:

Hi Sandra,

is there a reason why you use wlr-randr?

You can use this:

bindsym $mod+m output "HDMI-A-2" enable ; output "eDP-1" disable

Or you can use toggle instead of enable/disable, so you don't have to use different shortcuts. More information about this in the sway-output manpage.

Dear szlig

What a great solution!

bindsym $mod+m output "HDMI-A-2" toggle ; output "eDP-1" toggle

made the screens flash and then it enabled both. But just using enable/disable worked perfectly smile

Thanks smile

Offline

Board footer

Powered by FluxBB