add notification toggle
All checks were successful
Flake check / flake-check (pull_request) Successful in 22s
Build tests / build-hosts (pull_request) Successful in 29s

This commit is contained in:
sid 2026-05-10 23:24:41 +02:00
parent 9a659b4580
commit 6991318eb9
5 changed files with 65 additions and 0 deletions

View file

@ -0,0 +1,27 @@
{ pkgs, lib, ... }:
let
inherit (lib) mkDefault;
dunst = "${pkgs.dunst}/bin/dunstctl";
in
{
format = mkDefault "{icon}";
format-icons = {
unmuted = mkDefault "";
muted = mkDefault "";
};
return-type = mkDefault "json";
exec = mkDefault (
pkgs.writeShellScript "notifications" ''
is_paused=$(${dunst} is-paused)
if [ "$is_paused" = "true" ]; then
echo '{"alt": "muted", "class": "muted"}'
else
echo '{"alt": "unmuted", "class": "unmuted"}'
fi
''
);
on-click = mkDefault "dunst-toggle";
interval = mkDefault "once";
signal = mkDefault 12;
}