Fixing HIDPI on a bare i3 install (in Arch Linux btw)

Nowadays I’m running a bare install of i3-gaps on my Arch box. No “desktop environment” or things like that. Additionally I have three 4k displays attached to my machine. Getting HIDPI (I run @2) to run requires a few tricks, but once it’s done “everything” works fine in HIDPI mode.

Fixing your .Xdefaults

First we need to adjust our font DPI values in .Xdefaults. This is neccessary so non-GTK software will render fonts in a proper size. Add the following line to your .Xdefaults file:

Xft*dpi: 192

You could argue for a different DPI value than 192 (176 for example). But according to the internet you should keep it at integral multiples of 96 otherwise some software might render blurry text. Thoug I’ve been running at 176 for a few weeks and never noticed anything. So it’s up to you.

That’s everything we need to do in .Xdefaults. You can adjust anti aliasing and hinting if you like but that’s up to your personal setup.

Fixing your ENV

Now we need to add 2 variables to our ENVironment. I do this via my .zshrc file - but there’s many other ways. Just make sure these two get exported when you login and are active when you start X.

export GDK_SCALE=2
export GDK_DPI_SCALE=0.5

These two settings will make the UI scale @2 and will scale back the text to “normal” (we set text DPI already in .Xdefaults. If you leave out GDK_DPI_SCALE=0.5 you will get huge text. If you leave out .Xdefaults DPI settings to fix that you will get tiny text in some non-GTK apps. So just do as I say and be a happy camper.

Fixing Firefox

Refer to the Arch Wiki’s HIDPI guide for Firefox. You will need to set a few about:configs to make the text render properly in Firefox.

Final words

I’m pretty happy with this setup. Even Audacity looks less shit (it still looks like shit - but at least you can read the interface text now).