Skip to content

Instantly share code, notes, and snippets.

@eidantoei
Created June 8, 2012 07:52
Show Gist options
  • Save eidantoei/2894303 to your computer and use it in GitHub Desktop.
Save eidantoei/2894303 to your computer and use it in GitHub Desktop.
Quick mute Thunderbird notification sound (bash script)
#!/bin/bash
SND_ON="/Users/me/Music/win95.wav"
SND_OFF="/Users/me/Music/silent.wav"
SND_ALIAS="/Users/me/Music/thunderbird_notify.wav"
HASH_ON=$(md5 -q ${SND_ON})
HASH_OFF=$(md5 -q ${SND_OFF})
HASH_ALIAS=$(md5 -q ${SND_ALIAS})
CL_BLUE="\033[34m"
CL_PINK="\033[35m"
CL_RESET="\033[0m"
if [ "${HASH_ALIAS}" = "${HASH_OFF}" ];then
cp -p ${SND_ON} ${SND_ALIAS} && \
echo -e "OFF --> ${CL_BLUE}ON${CL_RESET}"
elif [ "${HASH_ALIAS}" = "${HASH_ON}" ];then
cp -p ${SND_OFF} ${SND_ALIAS} && \
echo -e "ON --> ${CL_PINK}OFF${CL_RESET}"
else
cp -p ${SND_ON} ${SND_ALIAS} && \
echo -e "??? --> ${CL_BLUE}ON${CL_RESET}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment