home/programs/waybar: configure notifications

This commit is contained in:
Anthony Rodriguez 2024-11-29 15:02:51 +01:00
parent 3cde68e4a9
commit a1f29d7417
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
2 changed files with 16 additions and 8 deletions

View file

@ -28,7 +28,12 @@ in {
modules-center = ["group/clock"];
modules-right =
["tray" "group/status" "group/power"]
++ lib.optional config.services.swaync.enable "custom/notification";
++ lib.optional config.services.swaync.enable "custom/swaync";
tray = {
icon-size = 16;
spacing = 12;
};
battery = {
interval = 10;
@ -154,24 +159,27 @@ in {
};
})
(mkIf config.services.swaync.enable {
"custom/notification" = {
tooltip = false;
format = "{icon} ";
"custom/swaync" = {
format = "<big>{icon}</big>";
format-icons = {
notification = "󱥁";
none = "󰍥";
dnd-notification = "󱅮";
dnd-none = "󱅯";
};
max-length = 3;
return-type = "json";
exec = "swaync-client -swb";
on-click = "swaync-client -t -sw";
escape = true;
exec-if = "which ${pkgs.swaynotificationcenter}/bin/swaync-client";
exec = "${pkgs.swaynotificationcenter}/bin/swaync-client --subscribe-waybar";
on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-panel --skip-wait";
on-click-middle = "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-dnd --skip-wait";
tooltip-format = "󰵚 {} notification(s)";
};
})
];
};
};
home.packages = [
pkgs.pavucontrol
];

View file

@ -86,6 +86,6 @@ window#waybar {
color: @base08;
}
#custom-notification {
#custom-swaync {
padding: 0 1.2em;
}