change beep
This commit is contained in:
parent
84c53e7fdd
commit
2c3be9f7ce
1 changed files with 31 additions and 8 deletions
39
functions.sh
39
functions.sh
|
@ -490,27 +490,50 @@ EOF
|
|||
}
|
||||
|
||||
turnoffbeep() {
|
||||
line='set bell-style none'
|
||||
changebeep none
|
||||
}
|
||||
|
||||
changebeep() {
|
||||
case $1 in
|
||||
none)
|
||||
style=visible
|
||||
;;
|
||||
visible)
|
||||
style=visible
|
||||
;;
|
||||
audible)
|
||||
style=audible
|
||||
;;
|
||||
*)
|
||||
echo "usage: changebeep [none|visible|audible]"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
line='set bell-style'
|
||||
file=~/.inputrc
|
||||
[ -e "$file" ] && grep -qxF "$line" "$file" || echo "$line" >> "$file"
|
||||
if [ -e "${file}" ] ; then
|
||||
sed -i -e "/$line/d" "${file}"
|
||||
fi
|
||||
echo "${line} ${style}" >> "${file}"
|
||||
return 0
|
||||
}
|
||||
|
||||
turnoffconfigsync() {
|
||||
line='MYSHELLCONFIG_GIT_SYNC='
|
||||
file=~/.bashrc
|
||||
if [ -e "$file" ] ; then
|
||||
sed -i -e "/$line/d" "${file}"
|
||||
if [ -e "${file}" ] ; then
|
||||
sed -i -e "/${line}/d" "${file}"
|
||||
fi
|
||||
sed -i -e "/#MYSHELLCONFIG-start/i${line}false" "$file"
|
||||
sed -i -e "/#MYSHELLCONFIG-start/i${line}false" "${file}"
|
||||
}
|
||||
|
||||
turnonconfigsync() {
|
||||
line='MYSHELLCONFIG_GIT_SYNC='
|
||||
file=~/.bashrc
|
||||
if [ -e "$file" ] ; then
|
||||
sed -i -e "/$line/d" "${file}"
|
||||
if [ -e "${file}" ] ; then
|
||||
sed -i -e "/${line}/d" "${file}"
|
||||
fi
|
||||
sed -i "/#MYSHELLCONFIG-start/i${line}true" "$file"
|
||||
sed -i "/#MYSHELLCONFIG-start/i${line}true" "${file}"
|
||||
}
|
||||
|
||||
#EOF
|
||||
|
|
Loading…
Reference in a new issue