How to check in shell which output is primary?

Maciej Sitarz macieksitarz at wp.pl
Mon Feb 13 10:16:55 PST 2012


Hi

I was trying to find a command telling which output reported by xrandr
is primary one.

I managed to find a solution, but not so clean and simple. One needs to
take the xdpyinfo information about mode and position from XINERAMA
extension and join it with xrandr's output to get the answer.
In one line:
xrandr | grep $(xdpyinfo -ext XINERAMA|awk '/^  head #0:/ {sub(",","+");
printf $3"+"$5}')

The simplest way would be to use xrandr, as it has all the data, but
unfortunately is not showing it. I modified xrandr's source (the patch
is attached) to output "primary" at the end of the line with primary
output's name.

Sample output:
Screen 0: minimum 320 x 200, current 1920 x 1200, maximum 8192 x 8192
DVI-D-1 connected 1920x1200+0+0 (normal left inverted right x axis y
axis) 518mm x 324mm primary
   1920x1200      60.0*+
   1600x1200      60.0

Do you know any other ways to check which output is primary?
Maybe it is possible to merge this patch into xrandr's source or apply
other changes to show this info?

Best Regards
-- 
Maciej Sitarz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xrandr_show_primary.patch
Type: text/x-patch
Size: 398 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20120213/0a21bea8/attachment.bin>


More information about the xorg mailing list