add notification agent for hyprland

This commit is contained in:
Yan Lin 2025-11-04 18:56:09 +01:00
parent 452b6e3548
commit e1a404d43d
2 changed files with 30 additions and 1 deletions

View file

@ -107,6 +107,7 @@
"gnome-keyring-daemon --start --components=secrets,ssh" "gnome-keyring-daemon --start --components=secrets,ssh"
"fcitx5 -d" "fcitx5 -d"
"hypridle" "hypridle"
"swaync"
"waybar" "waybar"
"nm-applet --indicator" "nm-applet --indicator"
"mkdir -p ~/Pictures/Screenshots" "mkdir -p ~/Pictures/Screenshots"
@ -418,7 +419,7 @@
modules-left = [ "hyprland/workspaces" "hyprland/window" ]; modules-left = [ "hyprland/workspaces" "hyprland/window" ];
modules-center = [ "clock" ]; modules-center = [ "clock" ];
modules-right = [ "pulseaudio" "backlight" "battery" "tray" ]; modules-right = [ "custom/notification" "pulseaudio" "backlight" "battery" "tray" ];
"hyprland/workspaces" = { "hyprland/workspaces" = {
format = "{name}"; format = "{name}";
@ -476,6 +477,27 @@
"tray" = { "tray" = {
spacing = 10; spacing = 10;
}; };
"custom/notification" = {
tooltip = false;
format = "{} {icon}";
format-icons = {
notification = "<span foreground='#f38ba8'><sup></sup></span>";
none = "";
dnd-notification = "<span foreground='#f38ba8'> <sup></sup></span>";
dnd-none = "";
inhibited-notification = "<span foreground='#f38ba8'> <sup></sup></span>";
inhibited-none = "";
dnd-inhibited-notification = "<span foreground='#f38ba8'> <sup></sup></span>";
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; color: #ffffff;
} }
/* Notification module styling */
#custom-notification {
padding: 0 10px;
color: #f38ba8; /* Pink/Red - Notifications */
}
/* Color-coded modules for easy distinction */ /* Color-coded modules for easy distinction */
#pulseaudio { #pulseaudio {
padding: 0 10px; padding: 0 10px;

View file

@ -65,5 +65,6 @@
networkmanagerapplet networkmanagerapplet
pavucontrol pavucontrol
nwg-displays nwg-displays
swaynotificationcenter
]; ];
} }