From 1bc90aa37f2af0904505e28b02f99a76c2127bbf Mon Sep 17 00:00:00 2001 From: dastarruer Date: Thu, 19 Feb 2026 17:10:26 -0400 Subject: [PATCH] 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> --- modules/dunst/hm.nix | 11 +++++++++ stylix/testbed/modules/application.nix | 31 ++++++++++++++++++-------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/modules/dunst/hm.nix b/modules/dunst/hm.nix index d83b35fc..5393ba01 100644 --- a/modules/dunst/hm.nix +++ b/modules/dunst/hm.nix @@ -43,5 +43,16 @@ mkTarget { }; } ) + ( + { polarity, icons }: + { + services.dunst = { + iconTheme = { + inherit (icons) package; + name = if polarity == "dark" then icons.dark else icons.light; + }; + }; + } + ) ]; } diff --git a/stylix/testbed/modules/application.nix b/stylix/testbed/modules/application.nix index 6d891bce..0609dc35 100644 --- a/stylix/testbed/modules/application.nix +++ b/stylix/testbed/modules/application.nix @@ -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"