chi*_*aha 9 display wayland 18.04
在 X 中,您可以使用 xrandr,但对于 Wayland / Ubuntu 18.04,该命令不起作用。在 Wayland / Ubuntu 18.04 中是否有一个简单的一行命令来更改屏幕显示分辨率?
(编辑 - 2023:更好的解决方案)我现在正在使用另一个工具来处理屏幕的激活/位置/主要属性:gnome-monitor-config来自https://github.com/jadahl/gnome-monitor-config/
对我来说它比 gnome-randr 更稳定并且很容易使用。定位并激活 3 个监视器(从左到右)的示例:
(最后一个参数上的2640是2160+480)
$ gnome-monitor-config set -LpM DP-2 -s2 -LM HDMI-3 -y 2160 -LM VGA-1
-y 2640
Run Code Online (Sandbox Code Playgroud)
要关闭非主监视器,只需忽略它们即可:
$ gnome-monitor-config set -LpM DP-2 -s2
Run Code Online (Sandbox Code Playgroud)
大多数应用程序(包括 Steam 游戏)在主显示器上启动,因此在另一个显示器上使用 -p 参数也很有用。将“HDMI-3”设为主显示器的示例:
$ gnome-monitor-config set -LM DP-2 -s2 -LpM HDMI-3 -y 2160 -LM VGA-1 -y 2640
Run Code Online (Sandbox Code Playgroud)
我不使用它(我更喜欢我的屏幕使用 EDID 提供的“本机”分辨率),但您也可以使用-mafterset命令修改分辨率。用于gnome-monitor-config list查找可用的模式/分辨率。例子 :
$ gnome-monitor-config set -LpM DP-2 -m 1920x1080@60,000
Run Code Online (Sandbox Code Playgroud)
-help输出 :
Options:
Commands:
list List current monitors and current configuration
set Set new configuration
show Show monitor labels
Options for 'set':
-L, --logical-monitor Add logical monitor
-x, --x=X Set x position of newly added logical monitor
-y, --y=Y Set y position of newly added logical monitor
-s, --scale=SCALE Set scale of newly added logical monitor
-t, --transform=TRANSFORM Set transform (normal, left, right, flip)
-p, --primary Mark the newly added logical monitor as primary
-M, --monitor=CONNECTOR Add a monitor (given its connector) to newly added
logical monitor
Run Code Online (Sandbox Code Playgroud)
——原答案——
我使用 gnome-randr。有人在一年前创建了它,“使用 mutter 的 dbus-api 为 gnome 桌面重新实现‘xrandr’的一些功能。目前尚未对分数缩放支持进行测试。”
您可以在这里下载: https: //gitlab.com/Oschowa/gnome-randr 然后您:
$ chmod +x gnome-randr.py
Run Code Online (Sandbox Code Playgroud)
您还可以将第一行替换为:
#!/usr/bin/env python3
Run Code Online (Sandbox Code Playgroud)
并运行它
$ ./gnome-randr.py
Run Code Online (Sandbox Code Playgroud)
它将为您提供显示器的当前配置和名称,例如 DP-1 DVI-1 HDMI-1。
然后你可以使用 xrandr 语法:
$ ./gnome-randr.py --output DP-1 --rotate normal --mode 1920x1080
Run Code Online (Sandbox Code Playgroud)
还可以为所有可能性提供帮助:
$ ./gnome-randr.py -h
usage: gnome-randr.py [options]
where options are:
--current
--dry-run
--persistent
--global-scale <global-scale>
--output <output>
--auto
--mode <mode>
--rate <rate>
--scale <scale>
--off
--right-of <output>
--left-of <output>
--above <output>
--below <output>
--same-as <output>
--rotate normal,inverted,left,right
--primary
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5813 次 |
| 最近记录: |