Right as I was getting ready to write this blog post, I decided to look at the post I made about 6 years ago about High DPI. I saw a line pertaining to firefox which I wanted to check and test, and then mistyped. I made the fonts for firefox (librewolf) 85 instead of .85 which meant I had to do some new magic to reduce it back to normal so I could undo the change I just made. What I did was to adjust one environment variable down to 0.05 and then restart my X session to be sure it took effect. When I started up my browser, everything was still much too large, but a single F from the File menu item did not fill nearly the whole screen. So much unexpected fun, as a prelude to writing about the mess that is DPI related settings in the realm of Linux.
We all know that there are multiple standards and multiple methods, and more variation on everything than we can name, which is all crying out for a standard that does not exist or is unheeded. Some weeks ago I chose to look for any and all environment variables which had any bearing on dpi or dimensionality of applications, their GUI, or how they were sized on the desktop. Using FVWM means that there is no integrated method that is nearly universal for my entire desktop or apps specifically written for use within it. KDE has its method primarily involving Qt, and GNOME primarily uses GTK, and there is also SDL which mostly relates to games but could affect multimedia applications. There is a decently capable configurator for Qt in ports at
If you are wondering which method is likely to govern how dpi or font sizes might be set, all that is necessary is to check the pkg info for the application, such as
librewolf-151.0.1 Name : librewolf Version : 151.0.1 Installed on : Fri May 29 00:33:55 2026 CDT Origin : www/librewolf Architecture : FreeBSD:15:amd64 Prefix : /usr/local Categories : wayland www Licenses : MPL20 Maintainer : freebsd@sysctl.cz WWW : https://librewolf.net/ Comment : Custom version of Firefox, focused on privacy, security and freedom Options : ALSA : off CANBERRA : off DBUS : on DEBUG : off FFMPEG : on JACK : on LIBPROXY : off LTO : off OPTIMIZED_CFLAGS: on PROFILE : on PULSEAUDIO : on SNDIO : on TEST : off Shared Libs required: libX11-xcb.so.1 libX11.so.6 libXcomposite.so.1 libXdamage.so.1 libXext.so.6 libXfixes.so.3 libXrandr.so.2 libatk-1.0.so.0 libc++.so.1 libc.so.7 libcairo-gobject.so.2 libcairo.so.2 libcxxrt.so.1 libdbus-1.so.3 libdl.so.1 libevent-2.1.so.7 libffi.so.8 libfontconfig.so.1 libfreetype.so.6 libgcc_s.so.1libgdk-3.so.0 libgdk_pixbuf-2.0.so.0 libgio-2.0.so.0 libglib-2.0.so.0 libgobject-2.0.so.0 libgtk-3.so.0 libharfbuzz.so.0 libjpeg.so.8 libm.so.5 libnspr4.so libnss3.so libnssutil3.so libpango-1.0.so.0 libpixman-1.so.0 libplc4.so libpng16.so.16 libsmime3.so libssl3.so libthr.so.3 libutil.so.10 libvpx.so.12 libwebp.so.7 libwebpdemux.so.2 libxcb-shm.so.0 libxcb.so.1 libz.so.6 Annotations : FreeBSD_version: 1500068 build_timestamp: 2026-05-26T22:04:59+0000 built_by : poudriere-git-3.4.8 cpe : cpe:2.3:a:mozilla:librewolf:151.0.1:::::freebsd15:x64 no_provide_shlib: yes port_checkout_unclean: no port_git_hash : b8257e1e1598db33ed01c9850a7218d07ba3fcd7 ports_top_checkout_unclean: no ports_top_git_hash: 04e1cd789391e25aa7c4687d407d2abbdd992286 repo_type : binary repository : FreeBSD-ports Flat size : 339MiB Description : LibreWolf is a free and open source web browser descended from the Mozilla Application Suite. It is small, fast and easy to use, and offers many advanced features: o Popup Blocking o Tabbed Browsing o Live Bookmarks (ie. RSS) o Extensions o Themes o FastFind o Improved Security
As I mentioned before, firefox and librewolf determine their scaling with a GDK variable and the same output for mudlet verifies that its a Qt application.
Mudlet-dev-g20260525 Name : Mudlet-dev Version : g20260525 Installed on : Fri May 29 02:01:23 2026 CDT Origin : games/Mudlet-dev Architecture : FreeBSD:15:amd64 Prefix : /usr/local Categories : games Licenses : GPLv2+ Maintainer : nope@nothere WWW : https://mudlet.org/ Comment : Cross-platform, open source, super fast MUD client with lua scripting Shared Libs required: libGLU.so.1 libGLX.so.0 libOpenGL.so.0 libQt6Concurrent.so.6 libQt6Core.so.6 libQt6Core5Compat.so.6 libQt6DBus.so.6libQt6Gui.so.6 libQt6Multimedia.so.6 libQt6MultimediaWidgets.so.6 libQt6Network.so.6 libQt6OpenGL.so.6 libQt6OpenGLWidgets.so.6 libQt6TextToSpeech.so.6 libQt6UiTools.so.6 libQt6Widgets.so.6 libassimp.so.6 libc++.so.1 libc.so.7 libcxxrt.so.1 libdl.so.1 libexecinfo.so.1 libgcc_s.so.1 libhunspell-1.7.so.0 libkvm.so.7 liblua-5.1.so libm.so.5 libonig.so.5 libpcre2-8.so.0 libpugixml.so.1 libqt6keychain.so.1 librt.so.1 libsqlite3.so.0 libsysinfo.so.0 libthr.so.3 libyajl.so.2 libz.so.6 libzip.so.5 Annotations : FreeBSD_version: 1501500 Flat size : 60.9MiB Description : Mudlet is a platform for gaming and enhancing game-play primarily with MUDs. Mudlet provides a toolkit and supports a wide variety of protocols for players and creators to tailor an immersive game-playing experience. MUD creators can use Mudlet to add visual flair or build features into their text games. MUD players can utilize the Mudlet toolkit to script and automate parts of their gameplay or add their own visual customization for game data. Outside the realm of MUD games, Mudlet has even been used to provide automation and features in 3D games which support in-game chat and a Telnet or similar server-console protocols.
The group of environment variables that have a bearing upon various UI elements or dimensionality are easily set, but finding a group of settings that is most appealing or mostly comparable may take some fiddling. I have begun to prefer small favicons on my browser tabs and relatively small font. What I have configured as a group of settings works fairly nice. I have read that antialiasing on 4k or above is not so pertinent. I choose to let Qt control the dpi automatically, mostly, some applications might not follow it or only use it for some portions or only use the qt scale factor method. These settings attempt to have as much uniformity as possible. The settings are good for a 4k screen.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ setenv FC_ANTIALIAS false setenv FC_SCALE 2.0 setenv GDK_BACKEND x11 setenv GDK_DPI_SCALE 1.0 setenv GDK_SCALE 1.5 setenv GDK_USE_XFT 1 setenv PLASMA_USE_QT_SCALING 1 setenv QT_AUTO_SCREEN_SCALE_FACTOR 1 setenv QT_ENABLE_HIGHDPI_SCALING 1 setenv QT_QPA_PLATFORM xcb setenv QT_QPA_PLATFORMTHEME qt6ct setenv QT_SCALE_FACTOR 2.0 setenv QT_XFT 1 setenv SDL_RENDER_DRIVER opengl setenv SDL_RENDER_VSYNC 1 setenv SDL_VIDEODRIVER x11 setenv SDL_VIDEO_FULLSCREEN_DISPLAY 0 setenv SDL_VIDEO_X11_SCALING_FACTOR 2.0 setenv SDL_VIDEO_X11_XRANDR 1 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Firefox and librewolf have an
In addition to these environment variables and individual application configurations, I have also added to my .Xdefaults or .Xresources file,
The settings as a whole works well for me. Aside from trying to search for environment variables generally, a large chunk of the HiDPI information is from Arch. We can dream of a day when everything on Linux can handle scaling identically across GTK/GDK and Qt and every other toolkit, with at most an evironment variable to select the system or toolkit, and the two or three for that system or toolkit that determine the scale or dpi of fonts and objects. Until that day arrives, but it may never arrive, we will have to periodically monitor to see what has changed among all the many methods, so we can get a coherent mostly consistent UI.
No comments:
Post a Comment