Created
January 26, 2023 10:34
-
-
Save cabezayunke/d9489c67ae5dbb3c17d20b9044b05d28 to your computer and use it in GitHub Desktop.
ubuntu do not disturb script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
do_not_disturb_on() { | |
notify-send "Notifications are disabled" -i user-busy | |
gsettings set org.gnome.desktop.notifications show-banners false | |
killall whatsie telegram-desktop slack | |
} | |
do_not_disturb_off() { | |
gsettings set org.gnome.desktop.notifications show-banners true | |
notify-send "Notifications are enabled" -i user-available | |
} | |
if [[ $1 == "on" ]] | |
then | |
echo "Forcing Do Not Disturb ON" | |
do_not_disturb_on | |
elif [[ $1 == "off" ]] | |
then | |
echo "Forcing Do Not Disturb OFF" | |
do_not_disturb_off | |
else | |
echo "Toggle Do Not Disturb" | |
value=$(gsettings get org.gnome.desktop.notifications show-banners) | |
if [[ $value == 'true' ]] | |
then | |
do_not_disturb_on | |
else | |
do_not_disturb_off | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment