wayland를 사용하여 명령줄에서 특정 디스플레이를 끄는 방법

wayland를 사용하여 명령줄에서 특정 디스플레이를 끄는 방법

이전에는 Wayland를 사용하지 않는 Linux 시스템을 사용했고 xrandr 프로그램을 통해 디스플레이를 제어할 수 있었습니다. 그래서 세 번째 디스플레이를 끄기 위해 다음 명령을 사용했습니다.

$ xrandr --output DP-1 --off

하지만 이제 Wayland에서는 새 표시 이름을 사용해도 더 이상 작동하지 않습니다.

$ xrandr
Screen 0: minimum 320 x 200, current 5760 x 1200, maximum 8192 x 8192
XWAYLAND0 connected 1920x1200+1920+0 (normal left inverted right x axis y axis) 520mm x 320mm
   1920x1200     59.88*+
XWAYLAND1 connected 1920x1080+0+120 (normal left inverted right x axis y axis) 380mm x 210mm
   1920x1080     59.96*+
XWAYLAND2 connected (normal left inverted right x axis y axis)
   1920x1080     59.96 +

$ xrandr --output XWAYLAND2 --off
<nothing happens>

그렇다면 Wayland를 사용할 때 명령줄에서 디스플레이를 켜고 끄는 방법이 있습니까? 나는 이것을 gnome 설정에서 제어할 수 있다는 것을 알고 있지만 명령줄에서 이를 수행해야 합니다. 따라서 이를 달성하기 위한 gsettings 명령이 있다면 이것도 괜찮습니다.

답변1

wlr-randr이를 달성하기 위해 사용할 수 있습니다 (https://github.com/emersion/wlr-randr).

다음 두 명령 중 하나를 사용하여 디스플레이/장치를 나열하십시오.

$ ls /sys/class/drm

또는

$ wlr-randr

그런 다음 (DP-1은 장치/디스플레이 이름)을 실행하여 끕니다.

$ wlr-randr --output DP-1 --off

arandr( 이름이 지정된 GUI 친화적인 버전도 있습니다.wdisplays https://github.com/cyclopsian/wdisplays)

관련 정보