From e2f99e576b7dcb337707a9bc44b897b778af9308 Mon Sep 17 00:00:00 2001 From: "Reid \"reidlab" Date: Mon, 21 Oct 2024 23:15:37 -0700 Subject: [PATCH] slightly nixify dunst --- README.md | 2 +- config/dunst.conf | 67 -------------------------------- modules/desktop/dunst.nix | 75 +++++++++++++++++++++++++++++++++++- modules/desktop/hyprlock.nix | 4 +- 4 files changed, 77 insertions(+), 71 deletions(-) delete mode 100644 config/dunst.conf diff --git a/README.md b/README.md index 4224b68..8737fc9 100755 --- a/README.md +++ b/README.md @@ -18,6 +18,6 @@ each host should have these files: - multi architecture configuration ([nix-systems](https://github.com/nix-systems/nix-systems)?) - divide steam and gamemode? - hidpi and cursor size option - - better theming for hyprlock, nwg-drawer, dunst, rofi (specifically accent for catppuccin) + - better theming for hyprlock, nwg-drawer, dunst, rofi (specifically accent for catppuccin on dunst and rofi and catppuccin) - remove battery ui in hyprlock if user isnt on laptop - wallpaper cycling \ No newline at end of file diff --git a/config/dunst.conf b/config/dunst.conf deleted file mode 100644 index ffc6b82..0000000 --- a/config/dunst.conf +++ /dev/null @@ -1,67 +0,0 @@ -# https://github.com/catppuccin/dunst/blob/main/src/mocha.conf -[global] -frame_color = "#f5c2e7" -separator_color = frame - -follow = "mouse" -width = 300 -height = 145 -origin = top-right -alignment = "left" -vertical_alignment = "center" -ellipsize = "middle" -offset = "15x15" -padding = 15 -horizontal_padding = 15 -text_icon_padding = 15 -icon_position = "left" -min_icon_size = 48 -max_icon_size = 64 -progress_bar = true -progress_bar_height = 8 -progress_bar_frame_width = 1 -progress_bar_min_width = 150 -progress_bar_max_width = 300 -separator_height = 2 -frame_width = 1 -corner_radius = 8 -transparency = 1 -gap_size = 8 -line_height = 0 -markup = "full" -format = "%a\n%s\n%b" -font = "Atkinson Hyperlegible Pro 11" -word_wrap = "yes" -ignore_newline = "no" -ignore_dbusclose = false -mouse_left_click = "do_action, close_current" -mouse_middle_click = "close_all" -mouse_right_click = "close_current" - -sort = "update" -shrink = "no" - -notification_limit = 4 -indicate_hidden = "yes" -idle_threshold = 120 -history_length = 20 -show_age_threshold = 60 -sticky_history = "yes" -show_indicators = "yes" -stack_duplicates = true -hide_duplicate_count = false -always_run_script = true - -[urgency_low] -background = "#1E1E2E30" -foreground = "#CDD6F4" - -[urgency_normal] -background = "#1E1E2E30" -foreground = "#CDD6F4" - -[urgency_critical] -background = "#1E1E2E30" -foreground = "#CDD6F4" -frame_color = "#FAB387" - diff --git a/modules/desktop/dunst.nix b/modules/desktop/dunst.nix index d5d56c1..5059db4 100644 --- a/modules/desktop/dunst.nix +++ b/modules/desktop/dunst.nix @@ -11,7 +11,80 @@ in { config = mkIf cfg.enable { hm.services.dunst = { enable = true; - configFile = ../../config/dunst.conf; + settings = with config.colorScheme.palette; { + global = { + follow = "mouse"; + width = 300; + height = 145; + frame_color = "#f5c2e7"; # catppuccin pink + + origin = "top-right"; + vertical_alignment = "center"; + ellipsize = "middle"; + + # various non-color theming settings + offset = "15x15"; + padding = 15; + horizontal_padding = 15; + text_icon_padding = 15; + corner_radius = 8; + gap_size = 8; + frame_width = 1; + transparency = 1; + + icon_position = "left"; + min_icon_size = 48; + max_icon_size = 64; + + progress_bar = true; + progress_bar_height = 8; + progress_bar_frame_width = 1; + progress_bar_min_width = 150; + progress_bar_max_width = 300; + + alignment = "left"; + markup = "full"; + format = "%a\\n%s\\n%b"; + font = with config.modules.desktop.fonts.fonts; "${sansSerif.family} ${toString sansSerif.size}"; + word_wrap = "yes"; + + ignore_newline = "no"; + ignore_dbusclose = false; + + mouse_left_click = "do_action, close_current"; + mouse_middle_click = "close_all"; + mouse_right_click = "close_current"; + + # sorting and history settings + sort = "update"; + notification_limit = 4; + indicate_hidden = "yes"; + idle_threshold = 120; + history_length = 20; + show_age_threshold = 60; + show_indicators = "yes"; + sticky_history = "yes"; + stack_duplicates = true; + hide_duplicate_count = false; + always_run_script = true; + }; + + urgency_low = { + background = "#${base00}30"; + foreground = "#${base05}"; + }; + + urgency_normal = { + background = "#${base00}30"; + foreground = "#${base05}"; + }; + + urgency_critical = { + background = "#${base00}30"; + foreground = "#${base05}"; + frame_color = "#${base08}"; # base16 spec says red + }; + }; }; }; } diff --git a/modules/desktop/hyprlock.nix b/modules/desktop/hyprlock.nix index 861ccb7..cfdbb13 100644 --- a/modules/desktop/hyprlock.nix +++ b/modules/desktop/hyprlock.nix @@ -16,11 +16,11 @@ in { config = mkIf cfg.enable { security.pam.services.hyprlock.text = "auth include login"; hm.home.packages = [ cfg.package ]; - hm.programs.hyprlock = with config.colorScheme.palette; { + hm.programs.hyprlock = { enable = true; package = cfg.package; - settings = { + settings = with config.colorScheme.palette; { general = { hide_cursor = false; no_fade_in = true;