stylix: set GTK icon theme (#603)
Closes: https://github.com/danth/stylix/issues/458 Link: https://github.com/danth/stylix/pull/603 Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> Tested-by: Kamron Bhavnagri <kamwithk@tuta.io>
This commit is contained in:
parent
7689e621f8
commit
f3c2f5a179
3 changed files with 49 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ in {
|
|||
../opacity.nix
|
||||
./cursor.nix
|
||||
./fonts.nix
|
||||
./icon.nix
|
||||
(import ./palette.nix { inherit palette-generator base16; })
|
||||
(import ../templates.nix inputs)
|
||||
] ++ autoload;
|
||||
|
|
|
|||
22
stylix/hm/icon.nix
Normal file
22
stylix/hm/icon.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.stylix.iconTheme;
|
||||
inherit (config.stylix) polarity;
|
||||
in {
|
||||
imports = [ ../icon.nix ];
|
||||
config = lib.mkIf (config.stylix.enable && cfg.enable) {
|
||||
gtk = {
|
||||
iconTheme = {
|
||||
inherit (cfg) package;
|
||||
name = builtins.head (lib.filter (x: null != x) [
|
||||
({
|
||||
inherit (cfg) dark light;
|
||||
}."${polarity}" or null)
|
||||
cfg.dark
|
||||
cfg.light
|
||||
]);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
26
stylix/icon.nix
Normal file
26
stylix/icon.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
options.stylix.iconTheme = {
|
||||
enable = lib.mkOption {
|
||||
description = "enable/disable icon theming.";
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
package = lib.mkOption {
|
||||
description = "Package providing the icon theme.";
|
||||
type = lib.types.nullOr lib.types.package;
|
||||
default = null;
|
||||
};
|
||||
light = lib.mkOption {
|
||||
description = "Light icon theme name.";
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
dark = lib.mkOption {
|
||||
description = "Dark icon theme name.";
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue