Catppuccin-kvantum not working

Continuing the discussion from Catppuccin-nix: the soothing pastel theme, but for nix!:

So, I’m trying to get catpuccin-kvantum working on my system to have all my qt5 and q6 applications use catppuccin mocha with a blue accent. I tried the approach outlined in the above post, which is to add the following to a file that home-mananger has in scope:

  home.packages = with pkgs; [
    (catppuccin-kvantum.override {
      accent = "Blue";
      variant = "Macchiato";
    })
    libsForQt5.qtstyleplugin-kvantum
    libsForQt5.qt5ct
  ];

  qt = {
    enable = true;
    platformTheme = "qtct";
    style.name = "kvantum";
  };

  xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini { }).generate "kvantum.kvconfig" {
    General.theme = "Catppuccin-Macchiato-Blue";
  };

But even after rebooting my machine, neither qt5ct nor kvantummanager let me set the color scheme to catppuccin. I’m not sure what I can do here.

Did nothing work? Not even with my configuration?

I did try your config, but it only gave me qt5ct and not qt6ct, and I couldn’t find the themes that I wanted in either kvantummanager or qt5ct.

I guess you need to specifically install qt6Packages.qt6ct then. I think another package installs it as a dependency for me that’s why I didn’t have it in the configs.

Let’s focus on qt5 for a minute. Do you see kvantum in qt5ct? If yes then select it.

And in kvantummanager, I assume the default themes exist, but there no is Catppuccin there, right?

If the default themes are there, do qt5 apps pick them up when you activate them?

Default themes are there, and if I select a default theme other apps pick up the changes just fine.

Changing theme in kvantummanager does change the themes in other running qt5 apps.

kvantummanager:

qt5ct:

qt5ct says the application is not configured correctly. What does it tell you when you click Information?

Your screenshot has the same error…
But anyways, it says this:

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

That environment variable is set by home-manager, I think.

Yeah, you’re right I didn’t pay attention to that xD

I’m using this configuration:

{ config, pkgs, ... }:
{
  catppuccin = {
    flavour = "mocha";
    accent = "blue";
  };

  gtk = {
    enable = true;
    catppuccin = {
      enable = true;
      cursor = {
        enable = true;
        flavour = "mocha";
        accent = "sapphire";
      };
    };
    cursorTheme.size = 48;
  };
  qt = {
    enable = true;
    platformTheme.name = "qtct";
    style.name = "kvantum";
  };

  home.pointerCursor = {
    x11.enable = true;
    gtk.enable = true;
    package = pkgs.catppuccin-cursors.mochaSapphire;
    name = "Catppuccin-Mocha-Sapphire-Cursors";
    size = 48;
  };

  home.packages = with pkgs; [
    (catppuccin-kvantum.override {
      variant = "Mocha";
      accent = "Blue";
    })
    libsForQt5.qtstyleplugin-kvantum
    libsForQt5.qt5ct
  ];
}

What’s confusing me is that it’s supposed to work. Try specifying the qt package directly like so:

  qt = {
    enable = true;
    platformTheme = "qtct";
    style = {
      name = "kvantum";
      package = pkgs.catppuccin-kvantum.override {
        variant = "Mocha";
        accent = "Blue";
      };
    };
  };

Edit: Now that I’m re-reading the code, I think the option platformTheme is specified directly and not with .name

  qt = {
    enable = true;
-    platformTheme.name = "qtct";
+    platformTheme = "qtct";
    style.name = "kvantum";
  };

Well, I specified the package like you said, and now kvantummanager isn’t even on my path. As for your second point, when using platformTheme home-manager tells me that this attribute is deprecated and I should use platformTheme.name instead.

This is very weird, because I’m specifying kvantummanager in both my home.packages and directly with qt.style.package

Well, let’s roll back to the previous code then.

You’re right. My home manager doesn’t tell me this, though.

I’m curious, what happens when you set the theme in your NixOS config as opposed to home-manager? It should be something like this:

  qt = {
    enable = true;
    platformTheme = "qt5ct";
    style = "kvantum";
  };
  environment.systemPackages = with pkgs; [
    (catppuccin-kvantum.override {
      variant = "Mocha";
      accent = "Blue";
    })
    #libsForQt5.qtstyleplugin-kvantum
    libsForQt5.qt5ct
  ];

I had to add something like the following, just adding pkgs.catppuccin-kvantum to home.packages doesn’t seem to add it to the proper path to be picked up by kvantummanager.

Probably not the most ideal solution, but I don’t use many Qt applications so I haven’t looked much further.

let
  variant = "Mocha";
  accent = "Mauve";
  kvantumThemePackage = pkgs.catppuccin-kvantum.override {
    inherit variant accent;
  };
in
{
  qt = {
    enable = true;
    platformTheme.name = "qtct";
    style.name = "kvantum";
  };

  xdg.configFile = {
    "Kvantum/kvantum.kvconfig".text = ''
      [General]
      theme=Catppuccin-${variant}-${accent}
    '';

    # The important bit is here, links the theme directory from the package to a directory under `~/.config`
    # where Kvantum should find it.
    "Kvantum/Catppuccin-${variant}-${accent}".source = "${kvantumThemePackage}/share/Kvantum/Catppuccin-${variant}-${accent}";
  };
}
2 Likes

This seems to work for me! Thank you so much!!!

The home-manager for 23.11 does this, but I guess it doesn’t do that for 24.05. I think this is definitely the best approach to add catppuccin-kvantum to catppuccin-nix if that’s the case.

1 Like

I’m using unstable so I’m on the latest versions of everything.

I’m also using unstable, but I think my home-manager is still configured to 23.11, that’s why it doesn’t give me deprecation warnings or anything:

  # This value determines the Home Manager release that your configuration is
  # compatible with. This helps avoid breakage when a new Home Manager release
  # introduces backwards incompatible changes.
  #
  # You should not change this value, even if you update Home Manager. If you do
  # want to update the value, then make sure to first check the Home Manager
  # release notes.
  home.stateVersion = "23.11"; # Please read the comment before changing.

I’m gonna keep it this way for now as I don’t want things to break, but I’ll look into changing this in the future.

Well, I thought this was working, but whenever I open a dropdown menu in a Qt5 program, or do a few other things that I haven’t fully debugged, it just opens up a window saying “WARNING: Qt: Could not find any platform plugin” and then the program just hangs forever and I have to kill it from the terminal.

Interesting, I haven’t run into any issues like that, though as I said I don’t use many Qt applications. I tried a couple programs that seem to be Qt5 based and while I did get a similar kf.windowsystem: Could not find any platform plugin warning in the terminal, I had no freezing issues.