{ 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;
}
