diff --git a/home/modules/dunst.nix b/home/modules/dunst.nix index 3e7a567..e7c20b0 100644 --- a/home/modules/dunst.nix +++ b/home/modules/dunst.nix @@ -15,7 +15,7 @@ in name = "rose-pine"; package = pkgs.rose-pine-icon-theme; }; - settings = import ./util/rose-pine-dunst.nix { inherit lib; theme = "default"; }; + settings = import ./util/rose-pine-dunst.nix { theme = "default"; }; }; # xdg.configFile."dunst/dunstrc.d/50-theme.conf".source = inputs.dunst-theme.outPath + "/rose-pine.conf"; diff --git a/home/modules/util/rose-pine-dunst.nix b/home/modules/util/rose-pine-dunst.nix index 8792a82..18b385f 100644 --- a/home/modules/util/rose-pine-dunst.nix +++ b/home/modules/util/rose-pine-dunst.nix @@ -1,4 +1,4 @@ -{ lib, theme ? "default" }: +{ theme ? "default" }: let configs = { @@ -32,6 +32,25 @@ let else configs.default; selectedConfig = getConfig theme; + + urgencyIcons = { + urgency_low = "dialog-information"; + urgency_normal = "dialog-warning"; + urgency_critical = "dialog-error"; + }; + + urgencyColors = + builtins.listToAttrs (map + (urgency: { + name = urgency; + value = rec { + inherit (selectedConfig.${urgency}) background highlight; + frame_color = highlight; + default_icon = urgencyIcons.${urgency}; + format = formatWithColor highlight; + }; + }) + [ "urgency_low" "urgency_normal" "urgency_critical" ]); in { global = { @@ -50,28 +69,5 @@ in icon_theme = "rose-pine-icons"; enable_recursive_icon_lookup = true; corner_radius = 2; - - inherit (selectedConfig.global) background foreground; - }; - - urgency_low = rec { - inherit (selectedConfig.urgency_low) background highlight; - frame_color = highlight; - default_icon = "dialog-information"; - format = formatWithColor highlight; - }; - - urgency_normal = rec { - inherit (selectedConfig.urgency_normal) background highlight; - frame_color = highlight; - default_icon = "dialog-warning"; - format = formatWithColor highlight; - }; - - urgency_critical = rec { - inherit (selectedConfig.urgency_critical) background highlight; - frame_color = highlight; - default_icon = "dialog-error"; - format = formatWithColor highlight; - }; -} + } // selectedConfig.global; +} // urgencyColors