Last updated on June 16, 2020 by Dan Nanni
One system setting that you often check or modify in Linux desktop environment is display setting, in particular, screen resolution. There are different ways to get display resolution information on Linux, either from the command line or from GUI-based display settings.
In this tutorial, I will describe how to find screen resolution in Linux desktop environment.
xdyinfo
One way to determine monitor resolution is via xdpyinfo
, a command-line utility for showing information about an X server, including current display resolution. To check the current screen resolution from the command line, simply run:
$ xdpyinfo | grep "dimensions" | awk '{ print $2 }'
1366x768
xrandr
The second screen resolution command is xrandr
, a command-line interface for RandR (short for "X Resize, Rotate and Reflect Extension"). The xrandr
command can show you the current screen resolution, as well as all possible display settings.
$ xrandr
Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y
axis) 344mm x 194mm
1366x768 60.0*+ 40.1
1360x768 59.8 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 disconnected (normal left inverted right x axis y axis)
As you can see above, if you run xrandr
command without any argument, you can get a list of all available screen resolutions. The currently set screen resolution is indicated with *
marker. Therefore, to find the current display resolution only, use the following command.
$ xrandr | grep '*' | awk '{ print $1 }'
1366x768
Every Linux desktop environment comes with its own GUI-based system settings, including display settings. Thus, you can use GUI-based display settings to determine the current screen resolution. To launch GUI-based display settings, you can use desktop-specific command line interface as demonstrated below.
To launch display settings on GNOME desktop environment, use either of the following commands:
$ gnome-control-center display
Or:
$ gnome-display-properties
To launch display settings on KDE desktop environment, run:
$ kcmshell4 display
To launch display settings on LXDE desktop environment, run:
$ lxrandr
To launch display settings on Xfce desktop environment, run:
$ xfce4-display-settings
This website is made possible by minimal ads and your gracious donation via PayPal or credit card
Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.
Xmodulo © 2021 ‒ About ‒ Write for Us ‒ Feed ‒ Powered by DigitalOcean