Skip to content

Instantly share code, notes, and snippets.

@rjpcasalino
Last active September 23, 2017 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjpcasalino/7ed1704e44ee5b9db5107a407c1591e8 to your computer and use it in GitHub Desktop.
Save rjpcasalino/7ed1704e44ee5b9db5107a407c1591e8 to your computer and use it in GitHub Desktop.

Found here:

https://blog.summercat.com/configuring-mixed-dpi-monitors-with-xrandr.html

Basic working command:

xrandr --dpi 276 --fb 7040x3960 \
    --output eDP1 --mode 3200x1800 \
    --output HDMI2 --scale 2x2 --pos 3200x0 --panning 3840x2160+3200+0

Here's an explanation of the options:

Global options: --dpi 276 sets the DPI to 276. --fb 7040x3960 creates one screen with resolution 7040x3960. This is the combined resolution of the two monitors. The high DPI monitor has 3200x1800 resolution. The lower DPI monitor has 1920x1080 resolution, but I double it as I scale it by 2 (see below). Combine these like so: 3200+19202 x 1800+10802 = 7040x3960. Both monitors share this screen. High DPI monitor options (--output eDP-1): --mode 3200x1800 says to use resolution 3200x1800. This is the default, but specifying it is necessary if the monitor is disabled (as it is when using the external monitor by itself) as it enables the monitor. Lower DPI monitor options (--output DP-1-2): --scale 2x2 is similar to zooming out. This is necessary as we set the DPI globally to that of the high DPI monitor. --pos positions it to the right of the laptop monitor. --panning allows our pointer to access the whole area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment