11.stylix/modules/dunst/hm.nix
dastarruer 1bc90aa37f
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>
2026-02-19 22:10:26 +01:00

58 lines
1.3 KiB
Nix

{ mkTarget, lib, ... }:
mkTarget {
config = [
(
{ fonts }:
{
services.dunst.settings.global.font =
"${fonts.sansSerif.name} ${toString fonts.sizes.popups}";
}
)
(
{ colors, opacity }:
{
services.dunst.settings =
with colors.withHashtag;
let
dunstOpacity = lib.toHexString (
((builtins.floor (opacity.popups * 100 + 0.5)) * 255) / 100
);
in
{
global = {
separator_color = base02;
};
urgency_low = {
background = base01 + dunstOpacity;
foreground = base05;
frame_color = base03;
};
urgency_normal = {
background = base01 + dunstOpacity;
foreground = base05;
frame_color = base0D;
};
urgency_critical = {
background = base01 + dunstOpacity;
foreground = base05;
frame_color = base08;
};
};
}
)
(
{ polarity, icons }:
{
services.dunst = {
iconTheme = {
inherit (icons) package;
name = if polarity == "dark" then icons.dark else icons.light;
};
};
}
)
];
}