Consistently theming apps in SwayWM on NixOS

Jelle Langedijk

2026/10/11

Blog Index ‒ Home

A little while ago I switched from GNOME to SwayWM. The main reason for doing so was the desire to have a simple lightweight window manager (again), so both the computer (in terms of resources) and I can focus better on the task at hand. Most of the work I do these days on GNU+Linux is in Librewolf (web browsing), LibreOffice (adminstrative work), since very recently Kate (Software Development, writing for this website, maintaining my computer) and Ghostty, my terminal emulator of choice. As you may know, this subset of programs alone already spans multiple application frameworks, namely GTK and QT. Ensuring all of them are themed consistently is not trivial, even less so when working with a minimal WM like Sway where everything is managed with config files, instead of a global "settings" program.

NB: I don’t use Nix flakes and home-manager, since they are not officialy part of NixOS.

GTK

One of the core issues with GTK is that major releases are not backwards compatible, meaning that GTK2, GTK3 and GTK4 all work ever so different. Depending on the app developers’ choice, it might be written in one of the GTK versions, altough it is likely to be GTK3 or GTK4 in 2026. When running ls  /.config/ | grep gtk, I get

    gtk-2.0
    gtk-3.0
    gtk-4.0
    gtkrc
    gtkrc-2.0

implying to me that I have apps everywhere on the GTK spectrum. I had the most success with uniformly theming them by using dconf. Assume the GTK theme to set is named <theme_name> and you prefer a dark theme, then

        dconf write /org/gnome/desktop/interface/gtk-theme "'<theme_name>'"
        dconf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"
        dconf write /org/gnome/desktop/interface/icon-theme "'Morewaita'"

where the last line is used to set the icon theme to MoreWaita, an extended Adwaita icon pack to ensure all icons display properly. The theme I’m currently using is named adw-gtk3, which is an attempt to unofficially backport Libwaita to GTK3. Furthermore, my  /.config/gtk-4.0/settings.ini file contains

[Settings]
gtk-application-prefer-dark-theme=1
gtk-theme-name=Adwaita

Lastly, I use GTKLock as a lockscreen. Its theme is set declaratively in my NixOS configuration

programs.gtklock = {
    enable = true;
    config = {
      main = {
        idle-hide = true;
        idle-timeout = 10;
        gtk-theme = "adw-gtk3-dark";
      };
    };
  };

QT

I was unable to find a way to programmaticaly set the QT themes to Breeze-Dark. Luckily, this can be done in Kate via the Settings - Window Color Scheme toolbar menu.



Made with LaTeX, pandoc, html and CSS. Found (spelling) mistakes? Feel free to open an issue on the repository.

The code of this webpage is publicly available, but without a license. The (raw) content on this webpage, including the code backing it is thus copyrighted. The only exception to this is the Ortica font designed by Ben Bovani that this website uses. It is licensed under the SIL Open Font License.

Hosted on StaticHost in Helsinki.