mirror of
https://github.com/kremalicious/dotfiles.git
synced 2025-02-17 07:27:25 +01:00
tweak bash_prompt
This commit is contained in:
parent
0e3024e858
commit
31dc084f0e
20
bash_prompt
20
bash_prompt
@ -65,7 +65,7 @@ prompt_git() {
|
|||||||
if tput setaf 1 &> /dev/null; then
|
if tput setaf 1 &> /dev/null; then
|
||||||
tput sgr0; # reset colors
|
tput sgr0; # reset colors
|
||||||
bold=$(tput bold);
|
bold=$(tput bold);
|
||||||
dim=$(tput setaf 7);
|
dim=$(tput setaf 8);
|
||||||
reset=$(tput sgr0);
|
reset=$(tput sgr0);
|
||||||
# Tomorrow colors, taken from https://github.com/Slava/vim-colors-tomorrow/blob/master/colors/tomorrow.vim
|
# Tomorrow colors, taken from https://github.com/Slava/vim-colors-tomorrow/blob/master/colors/tomorrow.vim
|
||||||
black=$(tput setaf 236);
|
black=$(tput setaf 236);
|
||||||
@ -99,24 +99,24 @@ fi;
|
|||||||
if [[ "${USER}" == "root" ]]; then
|
if [[ "${USER}" == "root" ]]; then
|
||||||
userStyle="${red}";
|
userStyle="${red}";
|
||||||
else
|
else
|
||||||
userStyle="${orange}";
|
userStyle="${gray}";
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
# Highlight the hostname when connected via SSH.
|
|
||||||
if [[ "${SSH_TTY}" ]]; then
|
if [[ "${SSH_TTY}" ]]; then
|
||||||
hostStyle="${bold}${red}";
|
PS1="\[\033]0;\W • \h\007\]"; # Set the terminal title
|
||||||
|
PS1+="\n";
|
||||||
|
PS1+="\[${userStyle}\]\u "; # username
|
||||||
|
PS1+="\[${orange}\]\h \[${reset}\]"; # host
|
||||||
else
|
else
|
||||||
hostStyle="${yellow}";
|
PS1="\[\033]0;\W\007\]"; # Set the terminal title
|
||||||
|
PS1+="\n";
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
# Set the terminal title to the current working directory.
|
|
||||||
PS1="\[\033]0;\W\007\]"; # working directory base name
|
|
||||||
PS1+="\n";
|
|
||||||
PS1+="\[${cyan}\]\w"; # working directory full path
|
PS1+="\[${cyan}\]\w"; # working directory full path
|
||||||
PS1+="\$(prompt_git \" \[${gray}\]\")"; # Git repository details
|
PS1+="\$(prompt_git \" \[${gray}\]\")"; # Git repository details
|
||||||
PS1+="\n";
|
PS1+="\n";
|
||||||
PS1+="\[${dim}\]→ \[${reset}\]"; # `→` (and reset color)
|
PS1+="\[${white}\]→ \[${reset}\]"; # `→` (and reset color)
|
||||||
export PS1;
|
export PS1;
|
||||||
|
|
||||||
PS2="\[${dim}\]→ \[${reset}\]";
|
PS2="\[${white}\]→ \[${reset}\]";
|
||||||
export PS2;
|
export PS2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user