Last active
February 1, 2020 15:55
-
-
Save JCGoran/926bdb17e140e65ee4156500f1459671 to your computer and use it in GitHub Desktop.
Enabling/disabling notifications on XFCE 4.14 with an indicator notification
This file contains 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
#!/usr/bin/env sh | |
# the main command to send | |
comm="xfconf-query -c xfce4-notifyd -p /do-not-disturb" | |
# query for status | |
status="$(${comm})" | |
# if 'Do not disturb' is off, we send a notification, and then turn it on | |
if [ "${status}" = "false" ] | |
then | |
notify-send 'NOTICE' 'Notifications have been disabled!' | |
eval "${comm} -T" | |
# otherwise we first turn it off, and then send the notification | |
elif [ "${status}" = "true" ] | |
then | |
eval "${comm} -T" | |
notify-send 'NOTICE' 'Notifications have been enabled!' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment