Update bash aliases

This commit is contained in:
MatMoul 2017-06-11 17:25:31 +02:00
parent d7e07d683a
commit 0ab7f0488c

View file

@ -19,9 +19,17 @@ options+=("f" "find . -name" on)
options+=("grep" "grep --color=auto" on) options+=("grep" "grep --color=auto" on)
options+=("egrep" "egrep --color=auto" on) options+=("egrep" "egrep --color=auto" on)
options+=("fgrep" "fgrep --color=auto" on) options+=("fgrep" "fgrep --color=auto" on)
options+=("ip" "alias ip='ip -c'" on)
options+=("pacman" "pacman --color auto" on)
options+=("pactree" "pactree --color" on)
options+=("vdir" "vdir --color=auto" on)
options+=("watch" "watch --color" on)
options+=("man" "color function" on)
options+=("mkdir" "mkdir -pv" off) options+=("mkdir" "mkdir -pv" off)
if [ -f /usr/bin/yaourt ]; then if [ -f /usr/bin/yaourt ]; then
options+=("yaourt" "sudo -u aurbuilder yaourt" on) options+=("yaourt" "sudo -u aurbuilder yaourt --color" on)
options+=("yaourt(2)" "sudo -u aurbuilder yaourt" off)
options+=("yaourt(3)" "yaourt --color" off)
fi fi
sel=$(whiptail --backtitle "$apptitle" --title "Aliases in /etc/profile.d/alias.sh :" --checklist "" --cancel-button "Back" 0 0 0 \ sel=$(whiptail --backtitle "$apptitle" --title "Aliases in /etc/profile.d/alias.sh :" --checklist "" --cancel-button "Back" 0 0 0 \
@ -53,8 +61,28 @@ for itm in $sel; do
'"grep"') echo "alias grep='grep --color=auto'" >> /etc/profile.d/alias.sh;; '"grep"') echo "alias grep='grep --color=auto'" >> /etc/profile.d/alias.sh;;
'"egrep"') echo "alias egrep='egrep --color=auto'" >> /etc/profile.d/alias.sh;; '"egrep"') echo "alias egrep='egrep --color=auto'" >> /etc/profile.d/alias.sh;;
'"fgrep"') echo "alias fgrep='fgrep --color=auto'" >> /etc/profile.d/alias.sh;; '"fgrep"') echo "alias fgrep='fgrep --color=auto'" >> /etc/profile.d/alias.sh;;
'"ip"') echo "alias ip='ip -c'" >> /etc/profile.d/alias.sh;;
'"pacman"') echo "alias pacman='pacman --color auto'" >> /etc/profile.d/alias.sh;;
'"pactree"') echo "alias pactree='pactree --color'" >> /etc/profile.d/alias.sh;;
'"vdir"') echo "alias vdir='vdir --color=auto'" >> /etc/profile.d/alias.sh;;
'"watch"') echo "alias watch='watch --color'" >> /etc/profile.d/alias.sh;;
'"man"')
echo "man() {" >> /etc/profile.d/alias.sh
echo " env \\" >> /etc/profile.d/alias.sh
echo " LESS_TERMCAP_mb=$(printf "\e[1;31m") \\" >> /etc/profile.d/alias.sh
echo " LESS_TERMCAP_md=$(printf "\e[1;31m") \\" >> /etc/profile.d/alias.sh
echo " LESS_TERMCAP_me=$(printf "\e[0m") \\" >> /etc/profile.d/alias.sh
echo " LESS_TERMCAP_se=$(printf "\e[0m") \\" >> /etc/profile.d/alias.sh
echo " LESS_TERMCAP_so=$(printf "\e[1;44;33m") \\" >> /etc/profile.d/alias.sh
echo " LESS_TERMCAP_ue=$(printf "\e[0m") \\" >> /etc/profile.d/alias.sh
echo " LESS_TERMCAP_us=$(printf "\e[1;32m") \\" >> /etc/profile.d/alias.sh
echo " man \"$@\"" >> /etc/profile.d/alias.sh
echo "}" >> /etc/profile.d/alias.sh
;;
'"mkdir"') echo "alias mkdir='mkdir -pv'" >> /etc/profile.d/alias.sh;; '"mkdir"') echo "alias mkdir='mkdir -pv'" >> /etc/profile.d/alias.sh;;
'"yaourt"') echo "alias yaourt='sudo -u aurbuilder yaourt'" >> /etc/profile.d/alias.sh;; '"yaourt"') echo "alias yaourt='sudo -u aurbuilder yaourt --color'" >> /etc/profile.d/alias.sh;;
'"yaourt(2)"') echo "alias yaourt='sudo -u aurbuilder yaourt'" >> /etc/profile.d/alias.sh;;
'"yaourt(3)"') echo "alias yaourt='yaourt --color'" >> /etc/profile.d/alias.sh;;
esac esac
done done