# Struggling to configure GTk/QT theme on laptop

**URL:** https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268
**Category:** Help
**Created:** [March 27, 2024, 12:57pm UTC](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268 "2024-03-27T12:57:42Z")
**Posts on this page:** 9
**Page:** 2

<div class="post-metadata">

### Author: ![heitorpb](https://discourse.nixos.org/user_avatar/discourse.nixos.org/heitorpb/32/16704_2.png) [@heitorpb](https://discourse.nixos.org/u/heitorpb)
#### Post date: [July 31, 2024, 1:01pm UTC](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268/21 "2024-07-31T13:01:30Z")

</div>

I got the theme working, but not the icons. I can’t change them in `qt5ct`, it appears locked there.

My current config for Qt is:

```nix
let
  catppuccinAccent = "Blue";
  catppuccinFlavor = "Macchiato";

  catppuccinKvantum = pkgs.catppuccin-kvantum.override {
      accent = catppuccinAccent;
      variant = catppuccinFlavor;
  };

  qtctConf = {
    Appearance = {
      custom_palette = false;
      icon_theme = "Papirus-Dark";
      standard_dialogs = "default";
      style = "kvantum";
    };
  };
in
{

  qt = lib.mkIf hasSeat {
    enable = true;
    platformTheme.name = "qtct";
    style.name = "kvantum";
  };
  xdg.configFile."qt5ct/qt5ct.conf".text = lib.generators.toINI { } qtctConf;
  xdg.configFile."qt6ct/qt6ct.conf".text = lib.generators.toINI { } qtctConf;
  xdg.configFile = {
    "Kvantum/kvantum.kvconfig".text = ''
      [General]
      theme=Catppuccin-${catppuccinFlavor}-${catppuccinAccent}
    '';

    "Kvantum/Catppuccin-${catppuccinFlavor}-${catppuccinAccent}".source = "${catppuccinKvantum}/share/Kvantum/Catppuccin-${catppuccinFlavor}-${catppuccinAccent}";
  };
};

```

Do you spot anything obviously wrong?

I have a feeling that the qtct configuration is not being applied, but don’t know how to check that. `kvantummanager` shows the theme nicely, but `qt5ct` appears to be locked in the icons.

---

<div class="post-metadata">

### Author: ![eljamm](https://discourse.nixos.org/user_avatar/discourse.nixos.org/eljamm/32/16466_2.png) [@eljamm](https://discourse.nixos.org/u/eljamm)
#### Post date: [July 31, 2024, 8:55pm UTC](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268/22 "2024-07-31T20:55:52Z")

</div>

Hey, @heitorpb, apologies for replying late, but I didn’t get a notification.

What I would suggest doing is checking if `$HOME/.config/qt5ct/qt5ct.conf` exists and has the correct contents. Else, I’d remove the lines where you declaratively configure `qt5ct` and `qt6ct` and I’d try manually getting it to work first.

Perhaps qt5ct wants its config file to be writeable or something?

---

<div class="post-metadata">

### Author: ![heitorpb](https://discourse.nixos.org/user_avatar/discourse.nixos.org/heitorpb/32/16704_2.png) [@heitorpb](https://discourse.nixos.org/u/heitorpb)
#### Post date: [August 5, 2024, 12:31pm UTC](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268/23 "2024-08-05T12:31:31Z")

</div>

I deleted `$HOME/.config/qt{5,6}ct/`, removed the static configs from my Nix files and tried to manually set the theme and icons and got nowhere. This is what I see in `qt6ct`:  
 ![qt6ct-icons](https://discourse.nixos.org/uploads/default/original/3X/a/6/a6849f085a89c79287d0a7737ab596d56a48e526.png)

It seems papirus-dark is not available for qtct? Curiously, when I open `pcmanfm-qt` and go to the settings, I can set the icons to papirus-dark and they appear.

---

<div class="post-metadata">

### Author: ![eljamm](https://discourse.nixos.org/user_avatar/discourse.nixos.org/eljamm/32/16466_2.png) [@eljamm](https://discourse.nixos.org/u/eljamm)
#### Post date: [August 5, 2024, 12:35pm UTC](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268/24 "2024-08-05T12:35:06Z")

</div>

Weird. Do none of those options work at all?

---

<div class="post-metadata">

### Author: ![heitorpb](https://discourse.nixos.org/user_avatar/discourse.nixos.org/heitorpb/32/16704_2.png) [@heitorpb](https://discourse.nixos.org/u/heitorpb)
#### Post date: [August 5, 2024, 12:38pm UTC](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268/25 "2024-08-05T12:38:48Z")

</div>

None of them work in qtxct. I can get `pcmanfm-qt` to use the icons though.

---

<div class="post-metadata">

### Author: ![eljamm](https://discourse.nixos.org/user_avatar/discourse.nixos.org/eljamm/32/16466_2.png) [@eljamm](https://discourse.nixos.org/u/eljamm)
#### Post date: [August 5, 2024, 12:45pm UTC](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268/26 "2024-08-05T12:45:06Z")

</div>

Does setting `XDG_CURRENT_DESKTOP` and `QT_QPA_PLATFORMTHEME` like in [Configuration of Qt 5/6 applications under environments other than KDE Plasma](https://wiki.archlinux.org/title/Qt#Configuration_of_Qt_5/6_applications_under_environments_other_than_KDE_Plasma) make a difference?

If that doesn’t work, you could also try explicitly installing `libsForQt5.qt5.qtsvg` and `kdePackages.qtsvg` like [Icon theme is not applied](https://wiki.archlinux.org/title/Qt#Icon_theme_is_not_applied) suggests.

---

<div class="post-metadata">

### Author: ![heitorpb](https://discourse.nixos.org/user_avatar/discourse.nixos.org/heitorpb/32/16704_2.png) [@heitorpb](https://discourse.nixos.org/u/heitorpb)
#### Post date: [August 12, 2024, 1:59pm UTC](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268/27 "2024-08-12T13:59:16Z")

</div>

There’s something odd with pavucontrol-qt, it simply does not show the icons (do you have icons in it?). But I can see icons in pcmanfm-qt. I switched to pavucontrol (gtk based) and moving on, not interested in troubleshooting this even further.

This is what I currently have for Qt:

```nix
{ lib, pkgs, ... }:
let
  catppuccinAccent = "Blue";
  catppuccinFlavor = "Macchiato";

  catppuccinKvantum = pkgs.catppuccin-kvantum.override {
    accent = catppuccinAccent;
    variant = catppuccinFlavor;
  };
in
{
  home.packages = with pkgs; lib.mkIf hasSeat [
    papirus-folders # Icons
    #catppuccin-papirus-folders # Conflicts with above

    # Theme for Qt apps
    catppuccinKvantum

    # I don't know If I need these
    libsForQt5.qt5ct
    #kdePackages.qt6ct
  ];

  # Qt setup
  qt = {
    enable = true;

    platformTheme.name = "kvantum";
    style = {
      name = "kvantum";

      catppuccin = {
        enable = true;
        apply = true;
        accent =lib.toLower catppuccinAccent;
        flavor =lib.toLower catppuccinFlavor;
      };
    };
  };
}

```

And my full config is here: [dotfiles-supimpas/home-manager/gtk-qt.nix at 5dab63213ed941fd4aa2207d3d4fe6f222fdb6e3 · heitorPB/dotfiles-supimpas · GitHub](https://github.com/heitorPB/dotfiles-supimpas/blob/5dab63213ed941fd4aa2207d3d4fe6f222fdb6e3/home-manager/gtk-qt.nix)

There may be some things I don’t need in this config, but it is working.

@eljamm huge thanks for your help!

---

<div class="post-metadata">

### Author: ![eljamm](https://discourse.nixos.org/user_avatar/discourse.nixos.org/eljamm/32/16466_2.png) [@eljamm](https://discourse.nixos.org/u/eljamm)
#### Post date: [August 12, 2024, 2:33pm UTC](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268/28 "2024-08-12T14:33:22Z")

</div>

I thought icons didn’t work on any qt application on your system, not just `pavucontrol-qt`, but apparently it’s just the fault of the application in this case since it doesn’t work for me either.

The fix for this should be pretty simple though, it just needs the `qtsvg` dependency and the icons work again.

**Edit:** Opened [pavucontrol-qt: add missing `qtsvg` dependency by eljamm · Pull Request #334155 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/pull/334155)

---

<div class="post-metadata">

### Author: ![heitorpb](https://discourse.nixos.org/user_avatar/discourse.nixos.org/heitorpb/32/16704_2.png) [@heitorpb](https://discourse.nixos.org/u/heitorpb)
#### Post date: [August 12, 2024, 2:57pm UTC](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268/29 "2024-08-12T14:57:36Z")

</div>

> [@eljamm](#):
>
> I thought icons didn’t work on any qt application on your system, not just `pavucontrol-qt`, but apparently it’s just the fault of the application in this case since it doesn’t work for me either.

Ouch, i’ve been banging my head for a while about it.

Thanks for figuring it out! You rock!

[Previous page](https://discourse.nixos.org/t/struggling-to-configure-gtk-qt-theme-on-laptop/42268.md?page=1)
