Starship Shell Prompt

- Add starship shell prompt to bash and fish shells
- Add config file for starship prompt
This commit is contained in:
Sravan Balaji
2020-12-05 21:05:57 -05:00
parent 937aea9724
commit fc813a9754
3 changed files with 119 additions and 95 deletions

44
.bashrc
View File

@@ -4,8 +4,8 @@
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
*i*) ;;
*) return ;;
esac
# don't put duplicate lines or lines starting with space in the history.
@@ -37,7 +37,7 @@ fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
xterm-color | *-256color) color_prompt=yes ;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
@@ -47,12 +47,12 @@ esac
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
color_prompt=
fi
fi
@@ -65,11 +65,11 @@ unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
xterm* | rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
*) ;;
esac
# enable color support of ls and also add handy aliases
@@ -109,20 +109,11 @@ fi
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# Powerline Shell
function _update_ps1() {
PS1=$(powerline-shell $?)
}
if [[ $TERM != linux && ! $PROMPT_COMMAND =~ _update_ps1 ]]; then
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# Run neofetch when opening terminal
@@ -134,3 +125,6 @@ alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
# EXPORTS
export EDITOR="code -w"
export TERM=xterm-256color
# Starship Prompt
eval "$(starship init bash)"