How to find screen resolution in Linux desktop environment

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.

Method One

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

Method Two

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

Method Three

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

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.

Leave a comment

Your email address will not be published. Required fields are marked *

Current day month ye@r *