sisyphus/scripts/do-not-disturb.sh
2023-11-19 15:42:58 +01:00

19 lines
458 B
Bash
Executable file

#!/usr/bin/env bash
# Script to toggle Do not disturb mode for dunst
# Get current state
if [ "$( command -v dunstctl )" ]; then
current_state="$( dunstctl is-paused )"
fi
# Toggle
if [ "${current_state}" == "false" ] ; then
notify-send 'Hiding notifications'
sleep 5
# makoctl set-mode do-not-disturb
dunstctl set-paused true
else
# makoctl set-mode default
dunstctl set-paused false
notify-send 'Showing notifications'
fi