home | hardware | software | misc | about | rss

OpenBSD and High DPI Displays

11-May-2024

I put OpenBSD back on the 4k X1 Carbon and realized that I forgot how I made X11 usable on a high DPI display last time. So I followed standard X11 troubleshooting procedures of changing the same config file name at all 947 possible paths that X11 will search for it until something looked different on the screen. If you're reading this, you probably are in the midst of this same procedure, and no, nothing I found online worked either.

For GTK and QT5 applications, I set to 2x scaling in my ~/.xsession like this:


export GDK_SCALE=2.0
export QT_SCALE_FACTOR=2.0

Note that it really is "GDK" instead of GTK.

Next, I set Xft.dpi and the Xcursor sizes in ~/.Xdefaults. The internet inists on telling you to change these in .Xresources, but don't do that. OpenBSD's xenocara really likes .Xdefaults. Even if I manually tried to xrdb load .Xresources, random stuff wouldn't work, like the Xcursor sizes (even though Xft.dpi did work for some reason). My ~/.Xdefaults is below:

Xft.dpi: 144
Xcursor.theme: Adwaita
Xcursor.size: 64

Obviously adjust those values as you desire.