Skip to content

Instantly share code, notes, and snippets.

@cellularmitosis

cellularmitosis/README.md

Last active Jul 12, 2020
Embed
What would you like to do?
Correcting Linux DPI (PPI)

Blog 2020/7/6

<- previous | index | next ->

Correcting Linux DPI (PPI)

For whatever reason, Linux (Debian Buster, XFCE) doesn't get my monitor's DPI correct. The symptom is that all text seems smaller than it should be.

(the other symptom is a sore wrist from hitting control-plus in chrome all day long!)

First, let's see what Linux thinks my DPI is:

$ xdpyinfo | grep -B 2 resolution
screen #0:
  dimensions:    2560x1440 pixels (677x381 millimeters)
  resolution:    96x96 dots per inch

I broke out a tape measure and whoa, that's way off! I measure 21 3/4" width, or about 552mm. That's more like 117 DPI.

But wait, Linux already knows this!!!:

$ xrandr | grep -w connected
DP-0 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 553mm x 311mm

47f6du

Regardless, the solution is simple: create a ~/.Xresources file, like so:

$ cat ~/.Xresources 
Xft.dpi: 117

Log out, log back in.

Things should look "normal" now, and you should see:

$ xdpyinfo | grep -B 2 resolution
screen #0:
  dimensions:    2560x1440 pixels (551x312 millimeters)
  resolution:    118x117 dots per inch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.