Things I needed to change for HiDPI on Linux that weren't in my X settings

April 4, 2022

A while back I wrote about my various settings in X to get programs working on my HiDPI display, partly in an attempt to document exactly this for my future use at work. Well, I just went through the exercise of converting from two Dell U2412M 1920x1200 displays to two Dell S2721Q 3840x2160 displays, and sadly I found a lot of places where I had to make changes other than those that I'd documented for my home use. Looking back, I needed to make a lot of those changes at home too (and they were captured in various places). This update isn't going to be comprehensive, and I'm going to be general in several spots.

I use a very custom desktop which requires me to do a lot of stuff by hand that's probably covered automatically (or with a general setting) by more standard desktops. With that said, the three big areas that I had to change were font selections, window sizes, and window positions. A subsidiary area has been tweaking the size of interface elements that are sized in pixels, like the width of xterm scroll bars.

Unfortunately, my eccentric environment has no central place where I specify all of my fonts. Instead they're spread over X resources, my window manager's configuration file, various scripts, and some programs that maintain their own choices (such as Firefox and Thunderbird). My window manager was using a mix of modern XFT fonts that specified their size in points (some of which I wanted to increase slightly), XFT fonts that specified their size in pixels (which definitely had to change), and some old XLFD bitmap fonts, which had to be replaced with XFT fonts. My X resources covered some programs that could be moved to XFT fonts or have the XFT font sizes adjusted, and some old programs that are still using XLFD bitmap fonts and I don't have a good solution for. I've adjusted the XLFD font sizes somewhat but the selection is limited and the results aren't as nice as with XFT fonts.

(I would like a modern version of xload that uses XFT fonts for its hostname label, but I don't expect to ever get one. Perhaps I should give my xload windows a titlebar and let my window manager handle it.)

I use a lot of old X programs that have their sizes specified in pixels. On a HiDPI display those pixels don't go as far, so windows need to be bigger. How much depends on various things including what new font sizes I'm using for them, so for things that I didn't also use on my home machine, it took repeated rounds of experimentation to determine the 'right' size. I have a bunch of fixed position windows, and when the size of windows and the displays changed, their positions had to be slid around. These sizes and positions are distributed all over the place; some were in my window manager configuration file, some in my X startup script, some in program configuration files, and some in helper scripts that I use to run things.

(In theory X resources should be the way to specify sizes only once for entire classes of windows, such as all of my xloads. In practice this has never worked very well in X. I have some theories about that, but that's for another entry.)

In theory a lot of my window placement follows geometric rules, where window Y is placed relative to window X, which is placed relative to a screen corner or some other fixed, easily determined location. In practice, I don't think there's any useful tool that can use these general geometric placements; instead, I placed things by hand then carefully determined positions and sizes using tools like xwininfo.

I probably still haven't found all of the things in my more complex work desktop environment that will need to be adjusted, resized, enlarged, and so on. Sometimes, custom X desktops can be a lot of work.

(This experience does make me see the attraction of having a central database that puts all of this in one place that everything looks at. At least then I would be changing a zillion things in only one place and it could be easier to find them all.)

PS: If you're going to do this sort of conversion, I strongly suggest taking some screen shots before hand so that you can easily look back to see how your environment used to look, what the relative sizes were, and so on.

Sidebar: xterm and urxvt scroll bar sizes

These are most conveniently set with X resources. I use:

XTerm*VT100.scrollbar.width: 24
URxvt*thickness: 24

The xterm default is apparently 14 pixels. I'm not sure what the urxvt default is. Terminals like gnome-terminal presumably scale things automatically.

Written on 04 April 2022.
« Some notes on using snmpwalk to poke at devices with SNMP
The failure of the idea of X resources »

Page tools: View Source, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Mon Apr 4 23:26:53 2022
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.