Created
March 5, 2025 23:33
-
-
Save b-rucel/25272dce27a725ae7eaccfc6a8b02319 to your computer and use it in GitHub Desktop.
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
git_branch() { | |
local branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) | |
if [[ -n "$branch" ]]; then | |
echo "${git_color}${branch}${reset} " | |
fi | |
} | |
git_color=$(tput setaf 2) # green | |
dir_color=$(tput setaf 6) # cyan | |
reset=$(tput sgr0) | |
if [[ $UID -eq 0 ]]; then | |
PROMPT=' %n %1~ $(git_branch)💀 ' # root user | |
else | |
PROMPT=' %n ${dir_color}%1~${reset} $(git_branch)👺 ' # normal user | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment