nixcfg/homeManagerModules/services/waybar/scripts/mako-dnd.sh

18 lines
431 B
Bash
Executable file

#!/usr/bin/env bash
show() {
MAKO_MODE=$(makoctl mode)
if echo "$MAKO_MODE" | grep -q "do-not-disturb"; then
printf '{"text": "󰂛", "class": "on", "tooltip": "Notifications snoozed."}\n'
else
printf '{"text": "󰂚", "class": "off","tooltip": "Notifications enabled."}\n'
fi
}
toggle() {
makoctl mode -t do-not-disturb
pkill -SIGRTMIN+2 .waybar-wrapped
}
[ $# -gt 0 ] && toggle || show