我只想编写一个脚本来更改我的屏幕分辨率。我找到了很多指南,但它们都是为 Xorg Display Server 用户制作的,我找不到适用于 Wayland 的指南。我的问题是,有没有办法使用 Wayland 编写一个脚本?
我想将主“XWAYLAND1”显示器更改为 1280x720,然后再改回 1920x1080。我使用的是 Ubuntu 22.10
xrandr 输出:
Screen 0: minimum 16 x 16, current 3360 x 1080, maximum 32767 x 32767
XWAYLAND1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
1920x1080 59.96*+
1440x1080 59.99
1400x1050 59.98
1280x1024 59.89
1280x960 59.94
1152x864 59.96
1024x768 59.92
800x600 59.86
640x480 59.38
320x240 59.52
1680x1050 59.95
1440x900 59.89
1280x800 59.81
720x480 59.71
640x400 59.95
320x200 58.96
1600x900 59.95
1368x768 59.88
1280x720 59.86
1024x576 59.90
864x486 59.92
720x400 59.55
640x350 59.77
1280x720_60.00 60.00
1920x1080_60.00 60.00
1024x768_60.00 60.00
XWAYLAND2 connected 1440x900+1920+0 (normal left inverted right x axis y axis) 410mm x 260mm
1440x900 59.75*+
1152x864 59.78
1024x768 59.68
800x600 59.47
640x480 59.38
320x240 59.52
1280x800 59.81
720x480 59.71
640x400 59.20
320x200 58.96
1368x768 59.71
1280x720 59.86
1024x576 59.58
864x486 59.45
720x400 59.55
640x350 58.91
gtf 1280 720 60 输出:
# 1280x720 @ 60.00 Hz (GTF) hsync: 44.76 kHz; pclk: 74.48 MHz
Modeline "1280x720_60.00" 74.48 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync
gtf 1920 1080 60 输出:
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync