cleanup and comment

This commit is contained in:
Erik Stambaugh 2024-06-13 09:00:35 -07:00
parent 5be36f345d
commit b95ee5ed3d

10
.bashrc
View file

@ -107,7 +107,6 @@ ps1_git() {
echo -e "\001\033[38;2;0;64;128m\002\001\033[38;2;255;192;128m\033[48;2;0;64;128m\002 ${BRANCH}\001\033[0m\033[38;2;0;64;128m\002\001\033[0m\002 "
else
echo -e "\001\033[38;2;128;0;92m\002\001\033[38;2;255;255;192m\033[48;2;128;0;92m\002 ${BRANCH}\001\033[0m\033[38;2;128;0;92m\002\001\033[0m\002 "
#echo "$(fgcolor 128 0 92)$(fgcolor 255 255 192)$(bgcolor 128 0 92) ${BRANCH}${ANSI_RESET}\033[38;2;128;0;92m\002\001\033[0m\002 "
fi
fi
}
@ -129,14 +128,11 @@ ps1_git() {
ps1_exitstr() {
EC=$?
if [[ $EC -ne 0 ]]; then
#echo -ne "$(fgcolor 192 0 0)${GLYPH_PRE}$(fgcolor 0 0 0)$(bgcolor 192 0 0)${GLYPH_EXIT} $?${ANSI_RESET}$(fgcolor 192 0 0)${GLYPH_SEP} "
echo -ne "\001\033[38;2;192;0;0m\002${GLYPH_PRE}\001\033[38;2;0;0;0m\033[48;2;192;0;0m\002${GLYPH_EXIT}\001\033[38;2;255;255;255m\002 ${EC}\001\033[0m\033[38;2;192;0;0m\002${GLYPH_SEP} "
fi
}
ps1_path() {
#pwd | sed -e 's/.*\/work\/tickets/⋯/' -e "s/$(echo $HOME | sed -e 's/\//\\\//g')/~/"
#pwd | sed -e 's/.*\/work\/tickets/ /' -e "s/$(echo $HOME | sed -e 's/\//\\\//g')/~/"
pwd | sed -e 's/.*\/work\/tickets\/*/ /' -e "s/$(echo $HOME | sed -e 's/\//\\\//g')/~/" -e 's/\([^ ]\)$/\1\//'
}
@ -144,10 +140,8 @@ if [ $USER == 'erik' ] || [ $USER == 'erikstambaugh' ]; then
PS1="${PARENTSTR}\$(ps1_exitstr)\$(ps1_jobs)"'$(ps1_git)'"$(fgcolor 0 192 255)${SHELLUSER}@\h:$(fgcolor 0 255 127)\$(ps1_path)${ANSI_RESET}\$ "
elif [ $USER == 'root' ]; then
PS1="${PARENTSTR}\$(ps1_exitstr)\$(ps1_jobs)"'$(ps1_git)'"$(fgcolor 255 72 64)${SHELLUSER}@\h:$(fgcolor 0 255 127)\$(ps1_path)${ANSI_RESET}# "
# PS1="${PARENTSTR}"'$(ps1_exitstr)$(ps1_git)'"\[$(fgcolor 255 72 64)\]${SHELLUSER}@\h:\[$(fgcolor 0 255 127)\]\w\[${ANSI_RESET}\]# "
else
PS1="${PARENTSTR}\$(ps1_exitstr)\$(ps1_jobs)"'$(ps1_git)'"$(fgcolor 255 255 0)${SHELLUSER}@\h:$(fgcolor 0 255 127)\$(ps1_path)${ANSI_RESET}\$ "
# PS1="${PARENTSTR}"'$(ps1_exitstr)$(ps1_git)'"\[$(fgcolor 255 255 0)\]${SHELLUSER}@\h:\[$(fgcolor 0 255 0)\]\w\[${ANSI_RESET}\]\$ "
fi
#export PS1 PATH LD_LIBRARY_PATH
@ -237,6 +231,10 @@ google() {
echo $CMD
}
# trivia was an inside joke at work. We had a trivia chatbot whose questions
# were terrible and I wanted to show I could write one equally bad
trivia() {
LINE=
while [[ -z $LINE ]]; do