0

I want to find a simple way to find the resolution of every monitor my computer is connected to.

For example, the primary monitor on my laptop is LVDS-1. I know the resolution is 1366x768 because of the following command:

$ xrandr | grep "LVDS-1"
LVDS-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm

Presumably, I could use the --listactivemonitors option to xrandr to retrieve this resolution. The output of this command is:

$ xrandr --listactivemonitors
Monitors: 1
 0: +*LVDS-1 1366/277x768/156+0+0  LVDS-1

My questions are:

  1. What do the numbers /277 and /156 mean in this output?
  2. Is there a simple command like mycommand LVDS-1 that will just return 1366x768?
1

1 Answer 1

0

You can try something like with awk:

xrandr | awk -F'[ +]' '/LVDS-1/ {print $4}'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .