For context I’m running a 2880 x 1620 display giving a DPI of ~ 212 on a 15.6" laptop screen. So as usual in XFCE I leave the scale setting under Display options untouched at 1x, and instead set Appearance → Settings → Window Scaling to 2x. I believe this is equivalent to going to the XFCE Settings Editor and in the last listed channel “xsettings” and having the first value Gdk > WindowScalingFactor set to 2.
There are a few remaining issues in TROMjaro after doing this:
__
1. Window header scaling
By default, some window headers are scaled, and others are not. This is very easy to fix initially by selecting the -HiDPI
theme variant in Window Manager → Style → Theme settings. E.g. if you have Skeuos-Green-Dark-XFWM
selected here, switch it to Skeuos-Green-Dark-XFWM-HiDPI
.
Unfortunately this gets reset and needs to be reapplied on every reboot. To fix this I needed to comment out all three lines relating to xfwm4 in /bin/fix-theming
[EDIT: With latest update I have had to redo this and with the new file I just commented out the middle two xfwm lines in the first block of code – i.e. lines 6: :
# xfwm4_theme=$(find /usr/share/themes/ /usr/local/share/themes/ "$HOME"/.themes/ "$HOME"/.local/share/themes/ -mindepth 2 -maxdepth 2 -type d -name xfwm4 -printf '%h\n' 2>/dev/null | grep -o "/${theme}[^/]*$" | sort | head -n1)
and 10:
# xfconf-query -c xfwm4 -p /general/theme -n -t string -s "${xfwm4_theme#/}"
]
I’m not sure what the best general case fix here would be. Ideally the code here would detect either the DPI, or that a scaling factor is applied, and if so, select a HiDPI variant window manager theme if available.
__
2. QT App scaling
I found that all QT programs were still not getting scaled at all. E.g. RiseUp VPN, VLC, Qoob, Tauon, MusicBrainz Picard, Shotcut, Lite XL, Stacer, QDirStat, Flameshot, Manjaro Settings Manager, XnView, Marble, Carla, Filelight, KolourPaint… and presumably any other KDE app like Kdenlive, Kate etc.
I fixed this by adding:
# Scale QT apps
export QT_SCALE_FACTOR=2
…to ~.profile (it did not work when added to either .bashrc or .bash_profile for some reason)
Since this works out of the box in MX Linux, I spent some time trying to figure out how they were doing it. Eventually with grep I discovered the file /etc/X11/Xsession.d/56xfce4-qtconfig which I think is how they are automating it:
# Set QT variables to only pass to gtk2 Xfce environment
# /etc/X11/Xsession.d/56xfce4-qtconfig
#
BASESTARTUP=$(basename "$STARTUP" | cut -d\ -f1)
if [ "$BASESTARTUP" = x-session-manager ]; then
BASESTARTUP=$(basename $(readlink /etc/alternatives/x-session-manager))
fi
case "$BASESTARTUP" in
xfce4-session|startxfce4)
#set qt environment variables to follow user chosen platform
#default plugin is gtk2
#$HOME/.config/MX-Linux/qt_plugin.conf can hold a user settable value
file="$HOME/.config/MX-Linux/qt_plugin.conf"
plugin="gtk2"
if [ -e "$file" ]; then
plugin=$(cat "$file")
fi
export QT_QPA_PLATFORMTHEME="$plugin"
export QT_PLATFORMTHEME="$plugin"
export QT_PLATFORM_PLUGIN="$plugin"
if command -v xfconf-query >/dev/null; then
export QT_SCALE_FACTOR=$(xfconf-query -c xsettings -p /Gdk/WindowScalingFactor 2>/dev/null)
[ -z "${QT_SCALE_FACTOR}" ] && unset QT_SCALE_FACTOR
fi
;;
esac
Edit:
Borrowing from this example, I have now updated my .profile to instead read:
# Scale QT apps
export QT_SCALE_FACTOR=$(xfconf-query -c xsettings -p /Gdk/WindowScalingFactor 2>/dev/null)
This seems to work fine for me as a more generic solution (just don’t forget the final close bracket like I did the first time or you won’t be able to load or log into the desktop environment…). I’m not sure why they need all the other bits in that file, but presumably there is good reason for it.
Maybe the way of extracting the system scaling factor here with xfconf-query could also be used as part of a solution for better choosing which window header theme to use.
__
3. Others
After doing all the above, scaling still did not work for either HardInfo or GIMP. I haven’t been able to find any fix for HardInfo unfortunately despite trying a few different environment variables. But GIMP is easily enough resolved as follows:
GIMP
Icons
Either set your desired DPI under Preferences → Interface → Display or select a custom icon size under Preference → Interface → Icon Theme.
Fonts
Go to the file:
/usr/share/gimp/2.0/themes/Dark/gtkrc
(or try changing to file in the ‘Light’ or ‘System’ directories instead of ‘Dark’. I thought it would be ‘System’, but ‘Dark’ is the one that worked for me).
In this file uncomment the line:
font_name = "Sans 11"
and change the 11 here to whatever you like to set the main menu font size.
And then also find the line:
GimpDock::font-scale = 0.8333
and similarly adjust the 0.8333 to set how the font size in the docks in scaled relative to the above. I ended up setting font_name to “Sans 20” and font-scale to 1.
__
P.S.
4. Wine
As described here, you can also increase the font size in Windows applications running under Wine, by running winecfg
and then adjusting the DPI settings in the ‘Graphics’ tab. I’m not sure if there is any way to also automate that, but the script example shown here suggests that it might be possible:
https://forum.winehq.org/viewtopic.php?t=34980
e.g. perhaps could simply multiply the 0x60 (default 96 DPI in hexadecimal) shown here by the scaling factor returned by the xfconf-query above.