Tech News
← Back to articles

How to configure X11 in a simple way

read original related products more articles

Speaking about xrandr . I tried some GUI applications, like arandr, to switch between various multimonitor configurations — but found that they all are using just a limited subset of xrandr features.

For example, I can't use mixed DPI settings or scale some outputs with arandr, but I can do it with xrandr: https://mas.to/@evgandr/114394277310057344. Yes, the X can do that! The well-known rumors (usually spreaded by Wayland fans) that only Wayland can do such things — looks like a fake.

There are some utilities to configure newly connected display(s) automatically, like autorandr or xlayoutdisplay. But I prefer to issue xrandr commands by my hands, when I attach additional display(s) to my laptop. Because automation not always works the necessary way.

For example, let's play with a big Benq XI2420z 24" monitor with 1920x1080 as a maximal available resoultion. I connected it to my laptop via good old VGA cable. So by default it reports not so much useful resolutions:

~ λ xrandr Screen 0: minimum 320 x 200, current 2560 x 1440, maximum 8192 x 8192 DP-3 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 277mm x 155mm 2560x1440 59.95*+ 39.97 VGA-1 connected (normal left inverted right x axis y axis) 1024x768 60.00 800x600 60.32 56.25 848x480 60.00 640x480 59.94 HDMI-1 disconnected (normal left inverted right x axis y axis) DP-1 disconnected (normal left inverted right x axis y axis) HDMI-2 disconnected (normal left inverted right x axis y axis) HDMI-3 disconnected (normal left inverted right x axis y axis) DP-2 disconnected (normal left inverted right x axis y axis)

I can use the --auto key to let the xrandr use some automation and connect my Benq as the monitor right of my main monitor:

~ λ xrandr --output VGA-1 --right-of DP-3 --auto ~ λ xrandr Screen 0: minimum 320 x 200, current 3584 x 1440, maximum 8192 x 8192 DP-3 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 277mm x 155mm 2560x1440 59.95*+ 39.97 VGA-1 connected 1024x768+2560+0 (normal left inverted right x axis y axis) 0mm x 0mm 1024x768 60.00* 800x600 60.32 56.25 848x480 60.00 640x480 59.94 HDMI-1 disconnected (normal left inverted right x axis y axis) DP-1 disconnected (normal left inverted right x axis y axis) HDMI-2 disconnected (normal left inverted right x axis y axis) HDMI-3 disconnected (normal left inverted right x axis y axis) DP-2 disconnected (normal left inverted right x axis y axis)

And it looks like not so good:

X output for primary display with 2560x1440 resolution and secondary with 1024x768 resolution

No problem! I'll add 1920x1080 resolution by myself!

... continue reading