{ lib, config, ... }: with lib; let cfg = config.modules.desktop.dunst; in { options.modules.desktop.dunst = { enable = mkEnableOption "Enable dunst, a lightweight replacement for the notification daemons provided by most desktop environments"; }; config = mkIf cfg.enable { hm.services.dunst = { enable = true; settings = let inherit (config.modules.desktop.themes) rounding padding; in with config.scheme.withHashtag; { global = { follow = "mouse"; width = 300; height = 145; frame_color = "${base02}"; origin = "top-right"; # various non-color theming settings offset = let offset = builtins.toString (padding * 2); in "${offset}x${offset}"; padding = padding; horizontal_padding = padding; text_icon_padding = padding; corner_radius = rounding; gap_size = 0; frame_width = 1; icon_position = "left"; progress_bar = true; progress_bar_frame_width = 1; progress_bar_corner_radius = rounding; alignment = "left"; markup = "full"; format = "%a\\n%s\\n%b"; font = with config.modules.desktop.fonts.fonts; "${sansSerif.family} ${toString sansSerif.size}"; mouse_left_click = "do_action, close_current"; mouse_middle_click = "close_all"; mouse_right_click = "close_current"; # sorting and history settings sort = "update"; indicate_hidden = "yes"; notification_limit = 5; idle_threshold = 120; history_length = 20; show_age_threshold = 60; show_indicators = "yes"; sticky_history = "yes"; }; urgency_low = { background = "${base00}FF"; foreground = "${base05}"; }; urgency_normal = { background = "${base00}FF"; foreground = "${base05}"; }; urgency_critical = { background = "${base00}FF"; foreground = "${base05}"; frame_color = "${base08}"; # base16 spec says red }; }; }; }; }