Last active
June 1, 2021 07:04
-
-
Save gedzeppelin/959a3f48a486e79e6170cd593386e164 to your computer and use it in GitHub Desktop.
Simple zsh theme with cloud anotation.
This file contains 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
# Functions | |
git_prompt_info() { | |
inside_git_repo="$(git rev-parse --is-inside-work-tree 2>/dev/null)" | |
if [ "$inside_git_repo" ]; then | |
branch=$(git branch | awk '/^\*/ { print $2 }') | |
echo "%{$RESET%}, in %{$GREEN%}$branch%{$RESET%} branch" | |
else | |
echo "" | |
fi; | |
} | |
get_dir() { | |
if [ "$(pwd)" = "$(eval echo ~$(id -n -u))" ]; then | |
echo "~/" | |
else | |
echo "%3~" | |
fi; | |
} | |
# Colors | |
RESET=$(echo '\033[0m') | |
BLUE=$(echo '\033[1;38;5;51m') | |
ORANGE=$(echo '\033[1;38;5;215m') | |
VIOLET=$(echo '\033[1;38;5;111m') | |
PINK=$(echo '\033[1;38;5;218m') | |
GREEN=$(echo '\033[1;38;5;119m') | |
RED=$(echo '\033[1;38;5;9m') | |
# Custom prompt | |
PROMPT=$'%(?:%{$GREEN%}:%{$RED%})[%{$BLUE%}%T%(?:%{$GREEN%}:%{$RED%})] %(!.%{$RED%}.%{$ORANGE%})%n%{$RESET%} at %{$RED%}CLOUD:%{$VIOLET%}%m$(git_prompt_info) %(?:%{$GREEN%}:%{$RED%})[%{$BLUE%}$(get_dir)%(?:%{$GREEN%}:%{$RED%})] | |
─▶%{$RESET%} ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment