Skip to content

Commit

Permalink
Replace default icon theme option with an icon theme name option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackaed authored and Mikilio committed Jan 18, 2025
1 parent e90d63a commit 69254a7
Showing 1 changed file with 21 additions and 30 deletions.
51 changes: 21 additions & 30 deletions modules/qt/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
}: {
options.stylix.targets.qt = {
enable = config.lib.stylix.mkEnableTarget "QT" pkgs.stdenv.hostPlatform.isLinux;
enableDefaultIcons = lib.mkOption {
iconThemeName = lib.mkOption {
description = "Default QT Icons";
type = lib.types.bool;
default = true;
type = lib.types.str;
default = "ePapirus-Dark";
};
};

Expand All @@ -30,20 +30,17 @@
cat ${svg} >>"$directory/Base16Kvantum.svg"
'';
in {
home.packages = with pkgs;
[
qt5ct
libsForQt5.qtstyleplugin-kvantum
qt6Packages.qtstyleplugin-kvantum
kvantumPackage
]
++ (lib.optionals cfg.enableDefaultIcons [
papirus-icon-theme
]);
home.packages = with pkgs; [
qt5ct
libsForQt5.qtstyleplugin-kvantum
qt6Packages.qtstyleplugin-kvantum
kvantumPackage
papirus-icon-theme
];

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

xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" {
Expand All @@ -52,22 +49,16 @@

xdg.configFile."Kvantum/Base16Kvantum".source = "${kvantumPackage}/share/Kvantum/Base16Kvantum";

xdg.configFile."qt5ct/qt5ct.conf".text =
''
[Appearance]
style=kvantum
''
+ (lib.optionalString cfg.enableDefaultIcons ''
icon_theme=ePapirus-Dark
'');
xdg.configFile."qt5ct/qt5ct.conf".text = ''
[Appearance]
style=kvantum
icon_theme=${cfg.iconThemeName}
'';

xdg.configFile."qt6ct/qt6ct.conf".text =
''
[Appearance]
style=kvantum
''
+ (lib.optionalString cfg.enableDefaultIcons ''
icon_theme=ePapirus-Dark
'');
xdg.configFile."qt6ct/qt6ct.conf".text = ''
[Appearance]
style=kvantum
icon_theme=${cfg.iconThemeName}
'';
});
}

0 comments on commit 69254a7

Please sign in to comment.