diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index e6936ac..248c212 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -6,65 +6,71 @@ let colors = import ../themes/colors.nix; # Import colors theme + + dunst-volume-notification = pkgs.writeShellScriptBin "volume-notify" '' + if [ "$(pulsemixer --get-mute)" = "0" ]; then dunstify -u low -r 1 "墳 $(pulsemixer --get-volume | awk '{print $1}')%" + else dunstify -u low -r 1 "婢 Muted"; fi + ''; + dunst-brightness-notification = pkgs.writeShellScriptBin "brightness-notify" '' + dunstify -u low -r 1 " $(light -G)%" + ''; in { - home.packages = [ pkgs.libnotify ]; # Dependency + cmds.notifications.volume = "volume-notify"; + cmds.notifications.brightness = "brightness-notify"; + + home.packages = [ + dunst-volume-notification + dunst-brightness-notification + pkgs.libnotify + ]; + services.dunst = { enable = true; - iconTheme = { # Icons - name = "Papirus Dark"; - package = pkgs.papirus-icon-theme; - size = "16x16"; - }; - settings = with colors.scheme.doom; { # Settings + settings = { global = { monitor = 0; - # geometry [{width}x{height}][+/-{x}+/-{y}] - # geometry = "600x50-50+65"; - width = 300; - height = 200; - origin = "top-right"; - offset = "50x50"; - shrink = "yes"; - transparency = 10; - padding = 16; - horizontal_padding = 16; - frame_width = 3; - frame_color = "#${bg}"; - separator_color = "frame"; - font = "FiraCode Nerd Font 10"; - line_height = 4; - idle_threshold = 120; + follow = "keyboard"; + indicate_hidden = "yes"; + shrink = true; + transparency = 0; + origin = "top-center"; + offset = "0x20"; + seperator_height = 0; + padding = 12; + horizontal_padding = 20; + frame_width = 4; + seperator_color = "auto"; + font = "${config.theme.font}"; markup = "full"; - format = ''%s\n%b''; - alignment = "left"; - vertical_alignment = "center"; - icon_position = "left"; + format = "%s%p\n%b"; + alignment = "center"; + show_age_threshold = 60; word_wrap = "yes"; + ellipsize = "middle"; ignore_newline = "no"; - show_indicators = "yes"; - sort = true; stack_duplicates = true; - # startup_notification = false; hide_duplicate_count = true; + show_indicators = "yes"; + icon_position = "off"; + sticky_history = "yes"; + history_length = 20; + always_run_script = true; + browser = "/usr/bin/xdg-open"; + corner_radius = 12; + force_xinerama = false; + mouse_left_click = "close_current"; + mouse_middle_click = "do_action"; + mouse_right_click = "close_all"; + progress_bar_min_width = "200"; + enable_recursive_icon_lookup = true; }; - urgency_low = { # Colors - background = "#${bg}"; - foreground = "#${text}"; - timeout = 4; - }; - urgency_normal = { - background = "#${bg}"; - foreground = "#${text}"; - timeout = 4; - }; - urgency_critical = { - background = "#${bg}"; - foreground = "#${text}"; - frame_color = "#${red}"; - timeout = 10; - }; + + urgency_low.timeout = 4; + urgency_normal.timeout = 8; + urgency_critical.timeout = 0; }; + }; xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source = "${pkgs.dunst}/share/dbus-1/services/org.knopwob.dunst.service"; }