I have a multi-monitor setup that I use with the X-plane 11 flight simulator. Typically I have two or three "large" monitors (1920x1200) for the scenery and main instrument panels and one or two "small" monitors (1024x768) that are part of the RealSimGear G1000 suite). I want to place the detached X-Plane 11 G1000 PFD and MFD windows on the appropriate monitors using a script. Currently, I have to move the windows manually which is a mess.
My first problem is to find out the coordinates of the small monitors on the composite display. So, how can I access this information? Is there a file I can parse with the relative positions of the monitors? Or should I use the output of xrandr
? Or is there a better way?
System stats below.
$ uname -a
Linux earth 5.11.0-37-generic #41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ gnome-shell --version
GNOME Shell 3.36.9
$ xrandr | grep -e 'Screen\|connected'
Screen 0: minimum 320 x 200, current 5760 x 1968, maximum 16384 x 16384
DisplayPort-0 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
DisplayPort-1 connected primary 1920x1200+1920+0 (normal left inverted right x axis y axis) 518mm x 324mm
DisplayPort-2 connected 1920x1200+3840+0 (normal left inverted right x axis y axis) 518mm x 324mm
HDMI-A-0 connected 1024x768+2351+1200 (normal left inverted right x axis y axis) 697mm x 392mm
$ sudo lspci | grep VGA
0a:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] (rev ca)