2022-06-02 11:47:06 +02:00
|
|
|
#!/usr/bin/env bash
|
2022-06-29 17:39:04 +02:00
|
|
|
# Script to toggle Do not disturb mode for mako and dunst
|
2022-06-02 11:47:06 +02:00
|
|
|
|
|
|
|
# Permanent memory
|
|
|
|
saved_state=0
|
|
|
|
|
|
|
|
# Toggle
|
2022-06-29 17:39:04 +02:00
|
|
|
if [[ ${saved_state} -eq 0 ]] ; then
|
2022-06-02 11:47:06 +02:00
|
|
|
~/.scripts/notify.sh 'Hiding notifications'
|
2022-06-29 17:39:04 +02:00
|
|
|
sleep 5
|
2022-06-02 11:47:06 +02:00
|
|
|
makoctl set-mode do-not-disturb
|
2022-06-29 17:39:04 +02:00
|
|
|
dunstctl set-paused true
|
2022-06-02 11:47:06 +02:00
|
|
|
else
|
|
|
|
makoctl set-mode default
|
2022-06-29 17:39:04 +02:00
|
|
|
dunstctl set-paused false
|
2022-06-02 11:47:06 +02:00
|
|
|
~/.scripts/notify.sh 'Showing notifications'
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Update status in file
|
2022-06-29 17:39:04 +02:00
|
|
|
new_state=$(( (${saved_state} + 1) % 2 ))
|
|
|
|
sed -i "s/^saved_state=.*$/saved_state=${new_state}/" "${0}"
|
2022-06-02 11:47:06 +02:00
|
|
|
|