dunst: set icon theme (#2201)

Closes: https://github.com/nix-community/stylix/issues/1948
Link: https://github.com/nix-community/stylix/pull/2201

Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
dastarruer 2026-02-19 17:10:26 -04:00 committed by GitHub
parent 801843d10e
commit 1bc90aa37f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 9 deletions

View file

@ -43,5 +43,16 @@ mkTarget {
};
}
)
(
{ polarity, icons }:
{
services.dunst = {
iconTheme = {
inherit (icons) package;
name = if polarity == "dark" then icons.dark else icons.light;
};
};
}
)
];
}

View file

@ -128,15 +128,28 @@ in
text = ''
for percent in {0..100}; do
${lib.concatMapStrings
(urgency: ''
notify-send \
--hint="int:value:$percent" \
--hint=string:x-dunst-stack-tag:${urgency} \
--urgency ${urgency} \
${urgency} \
urgency \
&
'')
(
urgency:
let
icon =
{
low = "dialog-information.svg";
normal = "dialog-warning.svg";
critical = "dialog-error.svg";
}
.${urgency};
in
''
notify-send \
--hint="int:value:$percent" \
--hint=string:x-dunst-stack-tag:${urgency} \
--icon ${pkgs.papirus-icon-theme}/share/icons/Papirus/32x32/status/${icon} \
--urgency ${urgency} \
${urgency} \
urgency \
&
''
)
[
"low"
"normal"