1 # turn off terminal beep in X
2 if [ -n "$DISPLAY" ] && [ "$TERM" == "xterm" ]; then
3 if [ -x "$(command -v xset)" ]; then
8 # turn of terminal beeps in the console, unless connecting via SSH
9 if [ -n "$TERM" ] && [ -z "$SSH_CLIENT" ]; then
10 setterm --blength 0 2>/dev/null || setterm -blength 0
13 # turn off beeps in Firefox
14 if [ -f ~/.mozilla/firefox/profiles.ini ]; then
15 for PROFILE in $(sed -n 's/Path=//p' .mozilla/firefox/profiles.ini); do
16 PREFERENCES=~/.mozilla/firefox/"${PROFILE}"/user.js
17 if [ -f "${PREFERENCES}" ]; then
18 if grep accessibility.typeaheadfind.enablesound "${PREFERENCES}" >/dev/null; then
19 sed -i 's/\("accessibility.typeaheadfind.enablesound"\)[^)]*/\1, false/' "${PREFERENCES}"
21 echo 'user_pref("accessibility.typeaheadfind.enablesound", false);' >>"${PREFERENCES}"
24 echo 'user_pref("accessibility.typeaheadfind.enablesound", false);' >>"${PREFERENCES}"