From d134687d440dcdd7274e0bf53e8c4a9a8a302ac3 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 26 Mar 2015 11:18:07 -0700 Subject: [PATCH] .bashrc.d/20nobeep: Disable accessibility.typeaheadfind.enablesound I don't want Firefox beeping every time I type something that can't be found in the current tab. Override the default value by editing user.js [1]. [1]: https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/A_brief_guide_to_Mozilla_preferences --- src/.bashrc.d/20nobeep | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/.bashrc.d/20nobeep b/src/.bashrc.d/20nobeep index b2a1d3e..6e6176f 100644 --- a/src/.bashrc.d/20nobeep +++ b/src/.bashrc.d/20nobeep @@ -9,3 +9,19 @@ fi if [ -n "$TERM" ] && [ -z "$SSH_CLIENT" ]; then setterm --blength 0 fi + +# turn off beeps in Firefox +if [ -f ~/.mozilla/firefox/profiles.ini ]; then + for PROFILE in $(sed -n 's/Path=//p' .mozilla/firefox/profiles.ini); do + PREFERENCES=~/.mozilla/firefox/"${PROFILE}"/user.js + if [ -f "${PREFERENCES}" ]; then + if grep accessibility.typeaheadfind.enablesound "${PREFERENCES}" >/dev/null; then + sed -i 's/\("accessibility.typeaheadfind.enablesound"\)[^)]*/\1, false/' "${PREFERENCES}" + else + echo 'user_pref("accessibility.typeaheadfind.enablesound", false);' >>"${PREFERENCES}" + fi + else + echo 'user_pref("accessibility.typeaheadfind.enablesound", false);' >>"${PREFERENCES}" + fi + done +fi -- 2.26.2