From e1a404d43d44cb0094ec5b538ac473ce02af4a35 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Tue, 4 Nov 2025 18:56:09 +0100 Subject: [PATCH] add notification agent for hyprland --- modules/hyprland/home.nix | 30 +++++++++++++++++++++++++++++- modules/hyprland/system.nix | 1 + 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/modules/hyprland/home.nix b/modules/hyprland/home.nix index b066897..d3910fe 100644 --- a/modules/hyprland/home.nix +++ b/modules/hyprland/home.nix @@ -107,6 +107,7 @@ "gnome-keyring-daemon --start --components=secrets,ssh" "fcitx5 -d" "hypridle" + "swaync" "waybar" "nm-applet --indicator" "mkdir -p ~/Pictures/Screenshots" @@ -418,7 +419,7 @@ modules-left = [ "hyprland/workspaces" "hyprland/window" ]; modules-center = [ "clock" ]; - modules-right = [ "pulseaudio" "backlight" "battery" "tray" ]; + modules-right = [ "custom/notification" "pulseaudio" "backlight" "battery" "tray" ]; "hyprland/workspaces" = { format = "{name}"; @@ -476,6 +477,27 @@ "tray" = { spacing = 10; }; + + "custom/notification" = { + tooltip = false; + format = "{} {icon}"; + format-icons = { + notification = ""; + none = ""; + dnd-notification = " "; + dnd-none = ""; + inhibited-notification = " "; + inhibited-none = ""; + dnd-inhibited-notification = " "; + dnd-inhibited-none = ""; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "sleep 0.1 && swaync-client -t -sw"; + on-click-right = "sleep 0.1 && swaync-client -d -sw"; + escape = true; + }; }; }; @@ -513,6 +535,12 @@ color: #ffffff; } + /* Notification module styling */ + #custom-notification { + padding: 0 10px; + color: #f38ba8; /* Pink/Red - Notifications */ + } + /* Color-coded modules for easy distinction */ #pulseaudio { padding: 0 10px; diff --git a/modules/hyprland/system.nix b/modules/hyprland/system.nix index bb57d24..316adc7 100644 --- a/modules/hyprland/system.nix +++ b/modules/hyprland/system.nix @@ -65,5 +65,6 @@ networkmanagerapplet pavucontrol nwg-displays + swaynotificationcenter ]; }