Skip to content

Instantly share code, notes, and snippets.

@cabezayunke
Created January 26, 2023 10:34
Show Gist options
  • Save cabezayunke/d9489c67ae5dbb3c17d20b9044b05d28 to your computer and use it in GitHub Desktop.
Save cabezayunke/d9489c67ae5dbb3c17d20b9044b05d28 to your computer and use it in GitHub Desktop.
ubuntu do not disturb script
#!/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