Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Changing fonts for GTK3 apps under KDE

Writer Matthew Barrera

I am running KUbuntu 20.04 and changed my default fonts there. The KDE system settings GUI has a button to configure GTK appearance, but this only allows changing the whole theme to another predefined theme.

I found two CLI utilities, gtk-chtheme and gtk-theme-switch2. One of them (I don't get which one) helped me apply the change to GTK2 apps.

But I am still stuck when it comes to GTK3 apps (the majority !).

I understand GTK switched from so-called RC files to their own flavour of CSS, but most information I can find seems directed at people creating whole new themes, which is way too complicated and overkill for me.

It does not help that search results (including here) are plagued with ultra old questions.

I am also intrigued by where Thunderbird gets it default fonts (Tinos, Arimo, Cousine) from, but that may be another question (or maybe not !).

1 Answer

Here is what I did to get my Noto Sans Condensed setting to apply to GTK3 apps.

I do not know if the first part is necessary since it worked for some programs (eg. Meld, dconf-editor) but not others (eg. Firefox, Thunderbird). Create or add to ~/.config/font-manager/local.conf :

<match target="pattern"> <test qual="any" name="family"><string>sans-serif</string></test> <edit name="family" mode="assign" binding="same"><string>Noto Sans Condensed</string></edit>
</match>

Second part ; I do not know which steps are really necessary or if they are redundant :

  • update ~/.config/xsettingsd/xsettingsd.conf with Gtk/FontName "Noto Sans Condensed, 11"
  • update ~/.config/gtk-3.0/settings.ini with gtk-font-name=Noto Sans Condensed, 11
  • in dconf, under org.gnome.desktop.interface, set font-name to 'Noto Sans Condensed, 11'.

Third part is taking into account that KDE's Plasma GTKd will erase the changes made in part two at login. I do not know if this is a misconfiguration on my part or a bug (KDE refers to the font as "Noto Sans" with the "Condensed" attribute while in GTK one needs to have "Noto Sans Condensed" as the font name ; maybe the setting transfer is buggy). So I just deactivated it in KDE Settings GUI, under Startup and Poweroff, Background services.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy