-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheystein.zsh-theme
35 lines (23 loc) · 1.03 KB
/
eystein.zsh-theme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Grab the current filepath, use shortcuts: ~/Desktop
# Append the current git branch, if in a git repository
#
# %n is username
# %m is servername
# %c is path
# Simple Prompt
EYSTEIN_CURRENT_LOCA_="%{$fg_bold[cyan]%}%~\$(git_prompt_info)%{$reset_color%}"
# Prompt with user
#EYSTEIN_CURRENT_LOCA_='[%{$fg_bold[blue]%}%n@%m%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)%{$reset_color%}]$ '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%} <%{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[white]%}"
# Do nothing if the branch is clean (no changes).
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%}>"
# Add a yellow ✗ if the branch is dirty
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[white]%}> %{$fg[yellow]%}✗"
gcloud_account="$(gcloud auth list --sort-by=~status --format json | jq -Mr '.[0].account')"
if [[ "$gcloud_account" =~ "oncall" ]]; then
EYSTEIN_CURRENT_LOCA_="%{$fg_bold[cyan]%}%~\$(git_prompt_info)%{$reset_color%} X"
else
# Put it all together!
PROMPT="$EYSTEIN_CURRENT_LOCA_ X%{$reset_color%} "
fi