dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 742d29ba3e1cd7934af3bfc35fd3ebb46aeb96fa parent 3c03b08a7d9d2c7250d8348e1fde447bcfa7f806 Author: maydayv7 <maydayv7@gmail.com> Date: Mon, 29 Dec 2025 17:20:38 +0530 feat: Use `swaync` instead of `dunst`
Diffstat:
| M | CHANGELOG.md | | | 1 | + |
| M | files/flake.nix | | | 3 | +++ |
| M | files/hyprland/theme/waybar.css | | | 4 | ++-- |
| M | files/niri/theme/waybar.css | | | 4 | ++-- |
| A | files/swaync.css | | | 246 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | modules/gui/desktop/_shared/notify.nix | | | 125 | +++++++++++++++++++++++++++++++++++++++++-------------------------------------- |
| M | modules/gui/desktop/_shared/panel.nix | | | 55 | ++++++++++++++++++++----------------------------------- |
| M | modules/gui/desktop/hyprland/settings/apps.nix | | | 11 | ++++++++++- |
| M | modules/gui/desktop/niri/apps/utilities.nix | | | 2 | +- |
| M | modules/gui/desktop/niri/settings/apps.nix | | | 2 | +- |
| M | modules/gui/desktop/niri/settings/default.nix | | | 7 | +++++++ |
| M | scripts/hyprutils.nix | | | 8 | +++----- |
| M | scripts/sysutils.nix | | | 3 | +-- |
13 files changed, 362 insertions(+), 109 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -2,6 +2,7 @@ ### December +- Use `swaync` instead of `dunst` - Niri Updates - Update to v25.11 - Use UWSM diff --git a/files/flake.nix b/files/flake.nix @@ -130,6 +130,9 @@ extension = ".sh"; }; + # Notifications Daemon + swaync = readFile ./swaync.css; + # Document Templates templates = ./templates; diff --git a/files/hyprland/theme/waybar.css b/files/hyprland/theme/waybar.css @@ -160,7 +160,7 @@ tooltip { color: @base00; } -#custom-dunst { +#custom-notify { color: @base0A; } @@ -175,8 +175,8 @@ tooltip { #bluetooth, #clock, #custom-dropdown, -#custom-dunst, #custom-logo, +#custom-notify, #custom-minimized, #custom-power, #custom-temperature, diff --git a/files/niri/theme/waybar.css b/files/niri/theme/waybar.css @@ -150,7 +150,7 @@ window#waybar.empty #window { color: @base00; } -#custom-dunst { +#custom-notify { color: @base0A; } @@ -164,8 +164,8 @@ window#waybar.empty #window { #bluetooth, #clock, #custom-dropdown, -#custom-dunst, #custom-logo, +#custom-notify, #custom-power, #custom-user, #custom-weather, diff --git a/files/swaync.css b/files/swaync.css @@ -0,0 +1,246 @@ +* { + all: unset; + transition: 200ms; + font-family: @font; + font-size: 16px; + font-weight: 500; +} + +/* Sliders */ +scale { + margin: 0 7px; +} + +scale trough { + margin: 0rem 1rem; + min-height: 10px; + min-width: 70px; + border-radius: 12px; +} + +trough { + background-color: #@base02; +} + +trough highlight { + background: #@base0D; +} + +trough slider { + margin: -10px; + border-radius: 12px; + background-color: #@base0D; + box-shadow: 0 0 2px rgba(0, 0, 0, 0.8); +} + +trough slider:hover { + box-shadow: + 0 0 2px rgba(0, 0, 0, 0.8), + 0 0 8px #@base0D; +} + +/* Notification */ +.notification-background { + background: alpha(#@base01, 0.95); + color: #@base05; + margin: 6px 12px; + border-radius: 12px; + box-shadow: + 0 0 8px rgba(0, 0, 0, 0.8), + inset 0 0 0 1px #@base03; + padding: 0; +} + +.notification { + padding: 7px; + border-radius: 12px; +} + +.notification.critical { + box-shadow: inset 0 0 7px #@base08; +} + +.notification-content { + margin: 7px; +} + +/* Icon */ +.notification-content overlay { + margin-right: 10px; +} + +.notification-content image { + -gtk-icon-size: 48px; + min-width: 48px; + min-height: 48px; + margin-right: 6px; +} + +/* Text */ +.notification-content .summary { + color: #@base05; + margin-bottom: 4px; +} + +.notification-content .time { + color: #@base04; +} + +.notification-content .body { + color: #@base05; + font-size: 14px; +} + +/* Buttons */ +.close-button { + margin: 7px; + padding: 4px; + border-radius: 6px; + background: #@base08; + color: #@base00; +} + +.close-button:hover { + background: #@base09; +} + +.notification-action { + background: #@base02; + color: #@base05; + margin: 4px; + padding: 8px; + border-radius: 7px; + box-shadow: inset 0 0 0 1px #@base03; +} + +.notification-action:hover { + background: #@base03; +} + +/* Progress Bar */ +.notification progress, +.notification trough, +.notification progressbar { + border-radius: 12px; + padding: 3px 0; +} + +.notification.low progress, +.notification.normal progress { + background: #@base0D; +} + +.notification.critical progress { + background: #@base08; +} + +/* Control Center */ +.control-center { + background: alpha(#@base00, 0.95); + color: #@base05; + padding: 14px; + border-radius: 12px; + box-shadow: + 0 0 8px rgba(0, 0, 0, 0.8), + inset 0 0 0 1px #@base02; +} + +/* Title */ +.widget-title { + margin-bottom: 10px; +} + +.widget-title > label { + font-size: 1.3em; +} + +.widget-title button { + background: #@base02; + color: #@base05; + padding: 7px; + border-radius: 7px; + box-shadow: inset 0 0 0 1px #@base03; +} + +.widget-title button:hover { + background: #@base03; +} + +/* DND */ +.widget-dnd { + padding: 10px; +} + +.widget-dnd > switch { + min-width: 30px; + min-height: 15px; + border-radius: 999px; + background: #@base02; +} + +.widget-dnd > switch:checked { + background: #@base0D; +} + +.widget-dnd > switch slider { + min-width: 15px; + min-height: 15px; + margin: 2px; + border-radius: 999px; + background: #@base05; +} + +/* Notification Group */ +.control-center .notification-group { + margin-top: 12px; +} + +.notification-group-icon { + margin-right: 12px; +} + +.notification-group-header { + margin-left: 4px; +} + +.notification-group-buttons { + margin-right: 12px; +} + +/* Volume/Backlight */ +.widget-volume, +.widget-backlight { + padding: 10px; +} + +.widget-volume trough highlight { + background: #@base0C; +} + +.widget-backlight trough highlight { + background: #@base0A; +} + +/* Scrollbar */ +scrollbar { + background-color: transparent; +} + +scrollbar slider { + min-width: 4px; + margin: 0 5px; + border-radius: 99px; + background-color: #@base03; + opacity: 0.3; + box-shadow: none !important; + border: none !important; + transition: all 0.3s ease; +} + +scrollbar:hover slider { + min-width: 8px; + margin: 0 3px; + opacity: 0.8; + background-color: #@base04; + box-shadow: none !important; +} diff --git a/modules/gui/desktop/_shared/notify.nix b/modules/gui/desktop/_shared/notify.nix @@ -1,17 +1,16 @@ { config, lib, + util, + files, ... }: let - inherit (lib) mkIf mkForce; - inherit (config._shared) enable theme; - inherit (theme) icons; - inherit (config.lib.stylix) colors; + inherit (lib) mkDefault mkIf; in { ## Notifications Configuration - config = mkIf enable { + config = mkIf config._shared.enable { # Phone Connect user.persist.directories = [ ".config/kdeconnect" ]; programs.kdeconnect.enable = true; @@ -22,69 +21,75 @@ in }; # Notifications Daemon - stylix.targets.dunst.enable = true; - services.dunst = - let - system = { - fullscreen = "show"; - highlight = "#${colors.base07}"; - history_ignore = "yes"; - override_pause_level = 70; - }; - in - { - enable = true; - iconTheme = icons; - settings = { - global = { - alignment = "center"; - corner_radius = 10; - follow = "mouse"; - format = "<b>%s</b>\\n%b"; - frame_width = 1; - horizontal_padding = 8; - icon_corner_radius = 10; - icon_position = "left"; - icon_theme = icons.name; - indicate_hidden = "yes"; - markup = "yes"; - max_icon_size = 64; - mouse_left_click = "do_action"; - mouse_middle_click = "close_all"; - mouse_right_click = "close_current"; - offset = "10x5"; - padding = 8; - progress_bar_corner_radius = 10; - separator_height = 1; - show_indicators = false; - shrink = "no"; - transparency = 10; - word_wrap = "yes"; + stylix.targets.swaync.enable = false; + services.swaync = { + enable = true; + style = util.build.theme { + inherit (config.stylix) fonts; + inherit (config.lib.stylix) colors; + file = files.swaync; + }; + + settings = { + # Notification + positionX = mkDefault "right"; + positionY = mkDefault "top"; + layer = "overlay"; + layer-shell = true; + cssPriority = "user"; + + image-visibility = "when-available"; + timeout = 10; + timeout-critical = 0; + timeout-low = 5; + notification-2fa-action = true; + notification-grouping = true; + notification-inline-replies = true; + + # Control Center + control-center-layer = "top"; + fit-to-screen = false; + control-center-margin-top = 3; + control-center-margin-left = 3; + control-center-margin-bottom = 3; + control-center-margin-right = 3; + + widgets = [ + "inhibitors" + "title" + "dnd" + "notifications" + ]; + + widget-config = { + title = { + text = "Notifications"; + clear-all-button = true; + button-text = "Clear"; }; + dnd.text = "Do Not Disturb"; + }; - urgency_low.frame_color = mkForce "#${colors.base0E}"; - urgency_normal.frame_color = mkForce "#${colors.base0D}"; - fullscreen_delay.fullscreen = "delay"; + notification-visibility = { utility = { - appname = "utility"; - } - // system; + app-name = "utility"; + state = "transient"; + }; upower = { - appname = "poweralertd"; - new_icon = "/run/current-system/sw/share/icons/${icons.name}/24x24/apps/preferences-system-power.svg"; - } - // system; - + app-name = "poweralertd"; + state = "transient"; + }; hyprland = { - appname = "grimblast"; - } - // system; + app-name = "grimblast"; + state = "transient"; + }; niri = { - appname = "niri"; - } - // system; + app-name = "niri"; + state = "transient"; + }; }; }; + }; }; }; } diff --git a/modules/gui/desktop/_shared/panel.nix b/modules/gui/desktop/_shared/panel.nix @@ -258,45 +258,30 @@ in }; "group/notify".modules = [ - "custom/dunst" + "custom/notify" "idle_inhibitor" ]; - "custom/dunst" = - let - run = - text: - "${ - pkgs.writeShellApplication { - name = "notify"; - inherit text; - runtimeInputs = with pkgs; [ - coreutils - dunst - ]; - } - }/bin/notify"; - in - { - tooltip = false; - on-click = "dunstctl history-pop"; - restart-interval = 1; - on-click-right = run '' - if dunstctl is-paused | grep -q "false" - then - dunstctl set-pause-level 50 - else - dunstctl set-pause-level 0 - fi - ''; - exec = run '' - COUNT=$(dunstctl count waiting) - ENABLED="" - DISABLED="" - if [ "$COUNT" != 0 ]; then DISABLED=" $COUNT"; fi - if dunstctl is-paused | grep -q "false"; then echo "$ENABLED"; else echo "$DISABLED"; fi - ''; + "custom/notify" = { + exec = "swaync-client -swb"; + exec-if = "which swaync-client"; + on-click = "swaync-client -t -sw"; + on-click-right = "swaync-client -d -sw"; + return-type = "json"; + escape = true; + tooltip = false; + format = "{icon}"; + format-icons = { + none = ""; + notification = ""; + dnd-none = ""; + dnd-notification = ""; + inhibited-none = ""; + inhibited-notification = ""; + dnd-inhibited-none = ""; + dnd-inhibited-notification = ""; }; + }; idle_inhibitor = { format = "{icon}"; diff --git a/modules/gui/desktop/hyprland/settings/apps.nix b/modules/gui/desktop/hyprland/settings/apps.nix @@ -76,7 +76,7 @@ in # Tools "$mod SHIFT, A, exec, sysutils toggle service waybar" "$mod SHIFT, D, exec, hyprutils toggle monitor ${display}" - "$mod, N, exec, dunstctl history-pop" + "$mod, N, exec, swaync-client -t -sw" "$mod, S, exec, hyprutils toggle shader" "$mod SHIFT, T, exec, pypr toggle term" "$mod, V, exec, pypr show clip" @@ -95,13 +95,22 @@ in "noanim, ^(hyprpicker)$" "blur, ^(hyprshell_overview)$" "dimaround, ^(hyprshell_overview)$" + "blur, ^(logout_dialog)$" "animation fade, ^(logout_dialog)$" + "blur, ^(nwg-drawer)$" "dimaround, ^(nwg-drawer)$" "animation fade, ^(nwg-drawer)$" + + "blur, ^(swaync-control-center)$" + "ignorealpha, ^(swaync-control-center)$" + "blur, ^(swaync-notification-window)$" + "ignorealpha, ^(swaync-notification-window)$" + "blur, ^(waybar)$" "ignorealpha, ^(waybar)$" + "blur, ^(wlclock)$" "ignorealpha, ^(wlclock)$" ]; diff --git a/modules/gui/desktop/niri/apps/utilities.nix b/modules/gui/desktop/niri/apps/utilities.nix @@ -19,7 +19,7 @@ wpaperd.enable = true; # Notifications - dunst.settings.global.origin = "top-left"; + swaync.settings.positionX = "left"; }; # Application Drawer diff --git a/modules/gui/desktop/niri/settings/apps.nix b/modules/gui/desktop/niri/settings/apps.nix @@ -76,7 +76,7 @@ # Utilities "Super+N" = { - action = spawn "dunstctl" "history-pop"; + action = spawn "swaync-client" "-t" "-sw"; hotkey-overlay.title = "Show Notifications"; }; diff --git a/modules/gui/desktop/niri/settings/default.nix b/modules/gui/desktop/niri/settings/default.nix @@ -64,5 +64,12 @@ with sys.lib.stylix.colors; max-scale 0.5 } } + + gestures { + hot-corners { + top-right + bottom-right + } + } ''; } diff --git a/scripts/hyprutils.nix b/scripts/hyprutils.nix @@ -61,14 +61,12 @@ recursiveUpdate gnugrep socat - dunst - zenity + custom.hyprshellevents hyprland hyprshade hyprsunset - custom.hyprshellevents - libnotify + zenity ]; text = '' @@ -76,7 +74,7 @@ recursiveUpdate ${files.scripts.commands} notify() { - notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:"$1" "''${@:2}" + notify-send -a "utility" -t 1000 -h string:x-canonical-private-synchronous:"$1" "''${@:2}" } hyprnotify() { diff --git a/scripts/sysutils.nix b/scripts/sysutils.nix @@ -42,7 +42,6 @@ recursiveUpdate alsa-utils brightnessctl brillo - dunst libnotify playerctl systemd @@ -55,7 +54,7 @@ recursiveUpdate show_music_in_volume_indicator=true notify() { - notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:"$1" "''${@:2}" + notify-send -a "utility" -t 1000 -h string:x-canonical-private-synchronous:"$1" "''${@:2}" } fail() {