desktop horizontal scrolling (panning) with xrandr

3wize

New Member
Joined
Nov 7, 2022
Messages
7
Reaction score
5
Credits
68
vertical_screens.jpg

This is a short guide on xrandr how to set up a dual screen desktop scrolling configuration as shown in the picture.

In this example the 2 displays used have a native resolution of 1920x1080 pixels.
On the left we have the VGA-1, on the right the HDMI-2.
Because they are used vertically, the resolution become 1080x1920 pixels.
As reminder: multiples of 1080 are 2160 and 4320.
The resolution of the whole virtual screen area, will be 4320x1920. Four times the single display width.
The area assigned to each display is 2160 wide and they will not overlap each other.

Bash:
xrandr --fb 4320x1920
 --output VGA-1  --mode 1920x1080 --rotate left  --left-of HDMI-2
 --pos 0x0    --panning 2160x1920+0000+0/2160x1920+0000+0
 
 --output HDMI-2 --mode 1920x1080 --rotate right --right-of VGA-1
 --pos 2161x0 --panning 2160x1920+2160+0/2160x1920+2160+0

The command set first a general framebuffer (--fb) total area.
Then follows 2 display specific options (--output) with several sub-options.

Please note how the --mode option is relative to the native resolution, while the --panning arguments refer to the virtual screen, where 1920 is used as height.
The --panning arguments are repeated ( /2160x1920+2160+0 ) to specify the area of the screen where the pointer can move.

To make the change permanent (applied at each login) you can make a script and add it to the Application Autostart list.

Bash:
#!/bin/sh
xrandr --fb 4320x1920 \
  --output VGA-1  --mode 1920x1080 --rotate left  --left-of HDMI-2 \
  --pos 0x0    --panning 2160x1920+0000+0/2160x1920+0000+0 \
  --output HDMI-2 --mode 1920x1080 --rotate right --right-of VGA-1 \
  --pos 3241x0 --panning 2160x1920+2160+0/2160x1920+2160+0

Here a reference on xrandr updated to the version 1.5 : xrandr man page


In case you need a quick zoom out to look at the whole desktop you can assign this to a keyboard shortcut:
Code:
xrandr --fb 4320x1920 --output VGA-1 --scale 2x2 --output HDMI-2 --scale 2x2
And this to go back to full size view:
Code:
xrandr --fb 4320x1920 --output VGA-1 --scale 1x1 --output HDMI-2 --scale 1x1
 
Last edited:


To avoid to resize windows manually, I use this script (called with a clic on a launcher icon) to automatically resize windows to fit half screen horizontally and vertically.

Code:
#!/bin/sh
xdotool windowsize $(xdotool selectwindow) 1076 920
 

Members online


Top