Only use xset to turn off beeps if we have it installed.
authorW. Trevor King <wking@tremily.us>
Fri, 11 May 2012 14:06:38 +0000 (10:06 -0400)
committerW. Trevor King <wking@tremily.us>
Fri, 11 May 2012 14:06:38 +0000 (10:06 -0400)
src/.bashrc.d/20nobeep

index 8eddcbfb18951f0ee4162bfc5747a6ffd26f8b3a..50fc3ec43e511b13b59b73ae835f6f4cf551cc63 100644 (file)
@@ -1,6 +1,10 @@
 # turn off terminal beep in X
 if [ $TERM == "xterm" ] && [ -n "$DISPLAY" ]; then
-       xset b off
+       XSET=$(which xset 2> /dev/null)
+       if [ -n "${XSET}" ]; then
+               xset b off
+       fi;
+       unset XSET
 fi
 
 # turn of terminal beeps in the console, unless connecting via SSH