Update dotfiles/.bashrc

This commit is contained in:
Brian Zalewski 2022-09-30 13:58:48 +00:00
parent 695b58a560
commit 54426f5bea

View file

@ -74,16 +74,18 @@ HISTFILESIZE=5000
HISTFILE=~/.bash_history HISTFILE=~/.bash_history
# Bash Completion # Bash Completion
if [ "$0" == 'bash' ]; then
if [ -f /usr/share/bash-completion/bash_completion ]; then if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion . /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion . /etc/bash_completion
fi fi
fi
# Prompt (on bash only)
if [ "$0" == 'bash' ]; then
# Add new line before prompt # Add new line before prompt
PROMPT_COMMAND="PROMPT_COMMAND=echo" PROMPT_COMMAND="PROMPT_COMMAND=echo"
# Prompt
if [ -f /etc/os-release ]; then if [ -f /etc/os-release ]; then
. /etc/os-release . /etc/os-release
if [ -d /Applications ] && [ -d /Library ] && [ -d /System ]; then if [ -d /Applications ] && [ -d /Library ] && [ -d /System ]; then
@ -140,6 +142,14 @@ else
OS_ICON= OS_ICON=
fi fi
# Set styled terminal prompt
case "$TERM" in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*|alacritty)
PS1="\n \[\033[0;34m\]╭─\[\033[0;31m\]\[\033[0;37m\]\[\033[41m\] $OS_ICON \u \[\033[0m\]\[\033[0;31m\]\[\033[44m\]\[\033[0;34m\]\[\033[44m\]\[\033[0;30m\]\[\033[44m\] \w \[\033[0m\]\[\033[0;34m\] \n \[\033[0;34m\]╰ \[\033[1;36m\]\$ \[\033[0m\]"
;;
esac
fi
### Miscellaneous ### Miscellaneous
export VISUAL=vim export VISUAL=vim
export EDITOR=$VISUAL export EDITOR=$VISUAL
@ -160,13 +170,6 @@ export LESSHISTFILE=-
# colorize ls # colorize ls
[ -x /usr/bin/dircolors ] && eval "$(dircolors -b)" [ -x /usr/bin/dircolors ] && eval "$(dircolors -b)"
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*|alacritty)
PS1="\n \[\033[0;34m\]╭─\[\033[0;31m\]\[\033[0;37m\]\[\033[41m\] $OS_ICON \u \[\033[0m\]\[\033[0;31m\]\[\033[44m\]\[\033[0;34m\]\[\033[44m\]\[\033[0;30m\]\[\033[44m\] \w \[\033[0m\]\[\033[0;34m\] \n \[\033[0;34m\]╰ \[\033[1;36m\]\$ \[\033[0m\]"
;;
esac
### Functions ### Functions
glog() { glog() {
setterm -linewrap off 2> /dev/null setterm -linewrap off 2> /dev/null