카테고리 없음

Sharing script to set dual monitors position

건이두 2019. 1. 14. 14:06
728x90

xrandr is a utility to set resolution and layout of multiple monitors.


Let me share my resolutions.


bkk@bkk-dt:~/bin$ xrandr
Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
DVI-I-2 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 527mm x 297mm
   1920x1080     60.00*+
   1600x900      60.00 
   1280x1024     75.02    60.02 
   1152x864      75.00 
   1024x768      75.03    60.00 
   800x600       75.00    60.32 
   640x480       75.00    59.94 
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-I-3 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 531mm x 299mm
   1920x1080     60.00*+
   1280x1024     75.02    60.02 
   1152x864      75.00 
   1024x768      75.03    60.00 
   800x600       75.00    60.32 
   640x480       75.00    59.94 


* mylayout.sh

#!/bin/sh

xrandr --output DVI-I-2 --mode 1920x1080 --pos -1920x0 --output DVI-I-3 --primary --mode 1920x1080 --pos 0x0 


Let me explain each arguments.

--output : port of graphic card, 'DVI-I-2' in here

--mode : what resolution you want to use, '1920x1080' in here

Please see that '--primary' is not used to 'DVI-I-2', it means that 'DVI-I-3' is primary monitor.

--output : DVI-I-3 is primary monitor as '--primary' is given

--mode : Resolution, 1920x1080

--pos : 0x0


* Two monitors layout

Monitor / DVI-I-2                               Monitor / DVI-I-3

***************************|***************************

* (-1920x0)                                 *|* (0x0)                                         *

*                                                  *|*                                                  *

*                                                  *|*                                                  *

*                                                  *|*                                                  *

***************************|***************************

728x90