26 lines
485 B
Bash
Executable File
26 lines
485 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -o nounset
|
|
|
|
_logfile="$LOGDIR/dunstctl.log"
|
|
|
|
log() {
|
|
printf '[%s] %s\n' "$(date -uIseconds)" "$*" >> "$_logfile"
|
|
}
|
|
|
|
case "$1 $2" in
|
|
"set-paused false")
|
|
log "Enabling dunst"
|
|
systemctl --user --no-block kill --signal SIGUSR2 dunst
|
|
|
|
;;
|
|
"set-paused true")
|
|
log "Disabling dunst"
|
|
systemctl --user --no-block kill --signal SIGUSR1 dunst
|
|
;;
|
|
*)
|
|
>&2 printf 'Unknown command\n'
|
|
exit 1
|
|
esac
|
|
|