Skip to content

Instantly share code, notes, and snippets.

@forgetso
Forked from nma/UbuntuHiDPI.md
Last active November 14, 2018 10:22
Show Gist options
  • Save forgetso/7d4155c530073d2a188d07d5a395ec75 to your computer and use it in GitHub Desktop.
Save forgetso/7d4155c530073d2a188d07d5a395ec75 to your computer and use it in GitHub Desktop.
DPI Scaling Fix for Ubuntu on HiDPI 3840x2160 eDP1 with two 1920x1080 External Monitors
#!/bin/bash
# Assumes that our global DPI default is for the Highest Resolution Monitor
# --scale 2x2: Our external monitor scale is 2x of our 4K monitor.
# --output <Name>: Just run xrandr without arguments to list device names.
# --mode: The supported mode of the --output monitor.
# --fb: 1920 * 2 x 1080 * 2 + 1080, or 3840x3240. Sets this monitors to fit this space.
# --pos: Set my external monitor locations starting at 0x0
xrandr --output DP-2 --scale 2x2 --mode 1920x1080 --fb 3840x3240 --pos 0x0
xrandr --output DP-1 --scale 2x2 --mode 1920x1080 --fb 3840x3240 --pos 3840x0
# --scale 1x1: Our laptop monitor is equal to our global DPI setting.
# --pos 960x2160: Move our screen down so it does not overlap the external monitor. (1920 * 2 - 1920) / 2 x 1080 * 2, or 960x2160
xrandr --output eDP-1 --scale 1x1 --pos 960x2160
# results in the following layout of monitors. Maximizing and minimizing on each desktop works.
# [ ] [ ]
# [ ]

Based on the contents http://blog.jamiek.it/2015/04/manually-fixing-multiple-screens-with.html

  • Set your Ubuntu to the highest DPI from the System Configurations
  • If not using Ubuntu, then you may need to configure based on instructions here and use a DPI calclator.
  • Please referer to the full blog post and give thanks to the OP.
  • This is just notes and a cached script for my personal laptop
  • I have two external monitors (DP-1 and DP-2) sitting to the top left and top right of my laptop screen (eDP-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment