Created
June 18, 2021 06:10
-
-
Save kiselev-nikolay/044dc9786d89a727d74c5c6dd4b728c6 to your computer and use it in GitHub Desktop.
Bash prompt which I put on my servers. beautiful and requires nothing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias i='hostname -I | cut -d " " -f 1' | |
alias ll='ls -alah' | |
alias fuck='git update-index --assume-unchanged' | |
alias unfuck='git update-index --no-assume-unchanged' | |
function getPS1() { | |
EXIT_CODE=$?; | |
printf "\n$(tput setaf 0)$(tput setab 2) $USER@$(i) $(tput sgr 0)"; | |
if [ -d ".git" ]; then | |
printf "$(tput setaf 0)$(tput setab 5) $(git rev-parse --abbrev-ref HEAD 2> /dev/null) $(tput sgr 0)" | |
fi | |
printf "$(tput setaf 0)$(tput setab 4) ${PWD##/home/$USER} $(tput sgr 0)"; | |
printf "$(tput setaf 4) $(tput sgr 0)\n"; | |
[[ EXIT_CODE -eq 0 ]] && printf "$(tput setaf 4)" || printf "$(tput setaf 1)" | |
printf " $(date +"%T")$(tput sgr 0)" | |
printf "$(tput bold) $(tput sgr 0)"; | |
} | |
export PS1='$(getPS1)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fira code nerd font and gruvbox