Skip to content

Instantly share code, notes, and snippets.

@dschreij
Last active August 6, 2020 07:58
Show Gist options
  • Save dschreij/148e958d032a61aa744b879e49a16d53 to your computer and use it in GitHub Desktop.
Save dschreij/148e958d032a61aa744b879e49a16d53 to your computer and use it in GitHub Desktop.
This is the script that I use for setting up my display scaling correctly on Ubuntu using `xrandr`. I have a 1920x1200 display on the left side connected on HDMI. On the right side I have a 4k display connected via display port. You can obtain the list of connected monitors and their respective ports using `xrandr query`.
#!/bin/sh
gsettings set org.gnome.desktop.interface scaling-factor 2
xrandr \
--dpi 162 \
--output USB-C-0 --off \
--output HDMI-0 --mode 1920x1200 --scale 2x2 --pos 0x0 --rotate normal \
--output DP-2 --primary --mode 3840x2160 --pos 3840x0 --scale 1.1x1.1 --rotate normal
echo "Xft.dpi: 162" | xrdb -merge
@dschreij
Copy link
Author

dschreij commented Aug 6, 2020

You can play around with the --scale parameters per display to get the scaling factor of your desire. I also think you can leave away the lines which contain the --off flag. These are not absolutely necessary.

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