Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: ctp.kvantum does not allow qt.platformTheme.name = qtct #275

Open
zspher opened this issue Jul 3, 2024 · 8 comments
Open

bug: ctp.kvantum does not allow qt.platformTheme.name = qtct #275

zspher opened this issue Jul 3, 2024 · 8 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@zspher
Copy link
Contributor

zspher commented Jul 3, 2024

ctp.kvantum does not allow qt.platformTheme.name = qtct. I use qtct to set icon theme and fonts while using kvantum.

{ lib, ...}: let
 data = {
   Appearance = {
     custom_palette = false;
     icon_theme = "Papirus-Dark";
     standard_dialogs = "default";
     style = "kvantum-dark";
   };

   Fonts = {
     fixed = "\"CaskaydiaMono Nerd Font Mono,10,-1,5,50,0,0,0,0,0,Regular\"";
     general = "\"Sans Serif,10,-1,5,50,0,0,0,0,0,Regular\"";
   };
 };
in {
 qt = {
   enable = true;
   style.name = "kvantum";
   platformTheme.name = "qtct";
   # platformTheme.name = "kvantum";
 };
 xdg.configFile."qt5ct/qt5ct.conf".text = lib.generators.toINI {} data;
 xdg.configFile."qt6ct/qt6ct.conf".text = lib.generators.toINI {} data;
}

So if possible can qtct be made an exception in

assertion = lib.elem (config.qt.platformTheme.name or null) [ "kvantum" ];

@heitorPB
Copy link

Did you find a solution/workaround to this?

@zspher
Copy link
Contributor Author

zspher commented Jul 30, 2024

Did you find a solution/workaround to this?

nope, just didn't use catppuccin/nix for kvantum, configured it in home-manager manually

@heitorPB
Copy link

Would you be so kind to share your configuration? I've been trying to get Qt themed but only frustrations so far.

@zspher
Copy link
Contributor Author

zspher commented Jul 31, 2024

sure,

  qt = let
    upperFirst = str:
    (lib.toUpper (builtins.substring 0 1 str))
    + (builtins.substring 1 (builtins.stringLength str) str);
    flavorCapitalized = upperFirst config.catppuccin.flavor;
    accentCapitalized = upperFirst config.catppuccin.accent;
  in {
    enable = true;
    platformTheme.name = "qtct";
    style.name = "kvantum";
    kde.settings."Kvantum/kvantum.kvconfig".General.theme = "Catppuccin-${flavorCapitalized}-${accentCapitalized}";
  };

ref:

@heitorPB
Copy link

Thank you!

@getchoo
Copy link
Member

getchoo commented Sep 21, 2024

Sorry for the long wait here, I've been a bit busy with things IRL and honestly I'm not very familiar with Qt/KDE/Kvantum theming

As of #244, I was under the impression that this was required alongside qt.style.name for the theme to apply most of the time. If this isn't the case, I'm happy to revert it; but some clarity here would be nice as it seems the Qt theming are a bit messy in general

CC @olifloof as author of that PR

@getchoo getchoo added bug Something isn't working help wanted Extra attention is needed labels Sep 21, 2024
@olifloof
Copy link
Contributor

i've somewhat recently switched to using the qtct port as the kvantum theme (by my experience) has had some issues with apps using qml

other than that, i'm also not very experienced with qt theming

@zspher
Copy link
Contributor Author

zspher commented Sep 22, 2024

i think this might clarify some things
the ff. must be done to set the qt theme

  1. setting QT_QPA_PLATFORMTHEME (with i.e kvantum, qtct)
  2. setting the style theme either through the platform theme (qtct) or directly QT_STYLE_OVERRIDE
  3. (optional) setting the kde themes via kdeglobals (for i.e kdeconnect)

for nixos this means

  1. qt.platformTheme.name for QT_QPA_PLATFORMTHEME and installing the platformTheme package
  2. qt.style.package to install the style package
  3. qt.style.name or use qtct to apply the style
  4. (optional) apply kde theme by reading ${pkgs.catppuccin-kde}/share/color-schemes/Catppuccin${flavor}${accent}.colors (ini to json) to kde.settings.kdeglobals

to apply the theme for qtct or kvantum config automatically use kde.settings. or xdg.configFile

sources: https://github.com/nix-community/home-manager/blob/master/modules/misc/qt.nix, https://github.com/nix-community/home-manager/blob/master/modules/misc/qt/kconfig.nix

for reference, my config: https://gist.github.com/zspher/e832aa4fd66f53a5fccac518b52eec19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants