0

I have a question about theming for Qt apps on Gnome.

I'm running NixOS with Gnome, using Home Manager and Flakes. My theme is Adwaita-dark, but I've noticed that some Qt apps such as VLC do not have a dark theme applied.

I tried tweaking all qt related settings in home.nix, but it didn't work.

I got a clue to what the issue was when I ran qt5ct and it showed this message:

Please remove the QT_STYLE_OVERRIDE environment variable (current value: adwaita).

The QT_QPA_PLATFORMTHEME environment variable is not set correctly (current value: gnome, required value: qt5ct).

I finally found a workaround by adding the following to configuration.nix:

  environment.variables = {
    "QT_STYLE_OVERRIDE" = pkgs.lib.mkForce "adwaita-dark";
  };

And now it works, Qt apps have the dark theme.

However, this feels like a messy hack and I'd like to understand how to do it properly, if possible. Has anyone dealt with this before?

1 Answer 1

0

qt.style = "adwaita-dark" should be a bit cleaner I think. I only found it now in docs: https://search.nixos.org/options?show=qt.style

EDIT: oops, that's NixOS option, not Home Manager's like you asked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .