starship alternative
This commit is contained in:
parent
cdf55b64dc
commit
bc59ba0cdf
2 changed files with 44 additions and 31 deletions
65
dot_bashrc
65
dot_bashrc
|
@ -29,7 +29,6 @@ HISTFILESIZE=2000
|
||||||
# update the values of LINES and COLUMNS.
|
# update the values of LINES and COLUMNS.
|
||||||
shopt -s checkwinsize
|
shopt -s checkwinsize
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# EDITOR
|
# EDITOR
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -43,29 +42,38 @@ export VISUAL=/usr/bin/vim
|
||||||
# PROMPT
|
# PROMPT
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
# set a minimalist prompt
|
if [ -f "/usr/bin/starship" ]; then
|
||||||
red='\[\e[0;31m\]' # Red
|
eval "$(starship init bash)"
|
||||||
green='\[\e[0;32m\]' # Green
|
|
||||||
blue='\[\e[0;34m\]' # Bold Blue
|
|
||||||
boldred='\[\e[1;31m\]' # Bold Red
|
|
||||||
reset='\[\e[0m\]' # Text Reset
|
|
||||||
|
|
||||||
if [ "$USER" = "root" ] ; then
|
|
||||||
# $bold$red
|
|
||||||
PROMPT_USER_COLOR=$boldred
|
|
||||||
PROMPT_SYMBOL="#"
|
|
||||||
else
|
else
|
||||||
PROMPT_USER_COLOR=$green
|
# set a minimalist prompt
|
||||||
PROMPT_SYMBOL="$"
|
red='\[\e[0;31m\]' # Red
|
||||||
fi
|
green='\[\e[0;32m\]' # Green
|
||||||
|
blue='\[\e[0;34m\]' # Bold Blue
|
||||||
|
boldred='\[\e[1;31m\]' # Bold Red
|
||||||
|
reset='\[\e[0m\]' # Text Reset
|
||||||
|
|
||||||
if [[ -n "$SSH_CLIENT$SSH2_CLIENT$SSH_TTY" ]] ; then
|
if [ "$USER" = "root" ] ; then
|
||||||
PROMPT_SSH="@\h"
|
# $bold$red
|
||||||
else
|
PROMPT_USER_COLOR=$boldred
|
||||||
PROMPT_SSH=""
|
PROMPT_SYMBOL="#"
|
||||||
fi
|
else
|
||||||
|
PROMPT_USER_COLOR=$green
|
||||||
|
PROMPT_SYMBOL="$"
|
||||||
|
fi
|
||||||
|
|
||||||
PS1="$PROMPT_USER_COLOR\u$PROMPT_SSH $blue\w$reset $PROMPT_SYMBOL "
|
if [[ -n "$SSH_CLIENT$SSH2_CLIENT$SSH_TTY" ]] ; then
|
||||||
|
PROMPT_SSH="@\h"
|
||||||
|
else
|
||||||
|
PROMPT_SSH=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
PS1="$PROMPT_USER_COLOR\u$PROMPT_SSH $blue\w$reset $PROMPT_SYMBOL "
|
||||||
|
|
||||||
|
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
|
||||||
|
GIT_PROMPT_ONLY_IN_REPO=1
|
||||||
|
source $HOME/.bash-git-prompt/gitprompt.sh
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# ALIASES
|
# ALIASES
|
||||||
|
@ -86,13 +94,6 @@ alias vi='/usr/bin/vim'
|
||||||
|
|
||||||
alias serve="python3 -m $(python3 -c 'import sys; print("http.server" if sys.version_info[:2] > (2,7) else "SimpleHTTPServer")')"
|
alias serve="python3 -m $(python3 -c 'import sys; print("http.server" if sys.version_info[:2] > (2,7) else "SimpleHTTPServer")')"
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
|
|
||||||
GIT_PROMPT_ONLY_IN_REPO=1
|
|
||||||
source $HOME/.bash-git-prompt/gitprompt.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
# PYTHON
|
# PYTHON
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
|
@ -111,7 +112,9 @@ fi
|
||||||
# Source all .bashrc files
|
# Source all .bashrc files
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
|
|
||||||
for file in ~/.bashrc.d/*.bashrc; do
|
if [ -d "$DIRECTORY" ]; then
|
||||||
. "$file"
|
for file in ~/.bashrc.d/*.bashrc; do
|
||||||
done
|
. "$file"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
10
private_dot_config/starship.toml
Normal file
10
private_dot_config/starship.toml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Inserts a blank line between shell prompts
|
||||||
|
add_newline = false
|
||||||
|
|
||||||
|
[git_status]
|
||||||
|
ahead = "⇡${count}"
|
||||||
|
diverged = "⇕⇡${ahead_count}⇣${behind_count}"
|
||||||
|
behind = "⇣${count}"
|
||||||
|
staged = '[+${count}](green)'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue