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.
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:
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.
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.
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:
To launch display settings on KDE desktop environment, run:
To launch display settings on LXDE desktop environment, run:
To launch display settings on Xfce desktop environment, run:
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!
Latest posts by Dan Nanni (see all)
- How to switch from NetworkManager to systemd-networkd on Linux - August 31, 2015
- How to set up a system status page of your infrastructure - August 25, 2015
- How to configure virtual hosts in Apache HTTP server - August 24, 2015