Abd*_*red 69 xfce wallpaper command-line resolution
我想找到最适合我的分辨率的壁纸。如何仅通过在命令行中编写命令来获得分辨率?
agu*_*slr 99
取自这个答案:
xdpyinfo | grep dimensions
Run Code Online (Sandbox Code Playgroud)
或者只获得分辨率:
xdpyinfo | awk '/dimensions/{print $2}'
Run Code Online (Sandbox Code Playgroud)
或者
xdpyinfo | grep -oP 'dimensions:\s+\K\S+'
Run Code Online (Sandbox Code Playgroud)
Syl*_*eau 39
我只会使用xrandr
:
$ xrandr
Screen 0: minimum 320 x 200, current 3520 x 1200, maximum 32767 x 32767
LVDS1 connected 1600x900+1920+0 (normal left inverted right x axis y axis) 310mm x 174mm
1600x900 60.0*+
1440x900 59.9
1360x768 59.8 60.0
1152x864 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
1920x1200 60.0*+
1920x1080 60.0 50.0 59.9 24.0 24.0
1920x1080i 60.1 50.0 60.0
1600x1200 60.0
1280x1024 75.0 60.0
1152x864 75.0
1280x720 60.0 50.0 59.9
1024x768 75.1 60.0
800x600 75.0 60.3
720x576 50.0
720x480 60.0 59.9
640x480 75.0 60.0 59.9
720x400 70.1
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
Run Code Online (Sandbox Code Playgroud)
这里我有两个屏幕,分辨率是:
要仅获得主显示器的分辨率,您还可以使用此 python oneliner:
$ python3 -c 'from gi.repository import Gdk; screen=Gdk.Screen.get_default(); \
geo = screen.get_monitor_geometry(screen.get_primary_monitor()); \
print(geo.width, "x", geo.height)'
1920 x 1200
Run Code Online (Sandbox Code Playgroud)
要获得扩展桌面的分辨率(用于多显示器设置):
$ python3 -c 'from gi.repository import Gdk; screen=Gdk.Screen.get_default(); \
print(screen.get_width(), "x", screen.get_height())'
3520 x 1200
Run Code Online (Sandbox Code Playgroud)
小智 10
请求是为了决议。这是由
xdpyinfo | grep resolution
Run Code Online (Sandbox Code Playgroud)
您还可以使用:
xrandr | grep ' connected'
Run Code Online (Sandbox Code Playgroud)
我的其中一台机器上的输出示例:
LVDS connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
Run Code Online (Sandbox Code Playgroud)