This repository has been archived by the owner on Apr 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 257
/
powerline.zsh-theme
165 lines (140 loc) · 5.31 KB
/
powerline.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# FreeAgent puts the powerline style in zsh !
if [ "$POWERLINE_DATE_FORMAT" = "" ]; then
POWERLINE_DATE_FORMAT=%D{%Y-%m-%d}
fi
if [ "$POWERLINE_RIGHT_B" = "" ]; then
POWERLINE_RIGHT_B=%D{%H:%M:%S}
elif [ "$POWERLINE_RIGHT_B" = "none" ]; then
POWERLINE_RIGHT_B=""
fi
if [ "$POWERLINE_RIGHT_A" = "mixed" ]; then
POWERLINE_RIGHT_A=%(?."$POWERLINE_DATE_FORMAT".%F{red}✘ %?)
elif [ "$POWERLINE_RIGHT_A" = "exit-status" ]; then
POWERLINE_RIGHT_A=%(?.%F{green}✔ %?.%F{red}✘ %?)
elif [ "$POWERLINE_RIGHT_A" = "exit-status-on-fail" ]; then
POWERLINE_RIGHT_A=%(?..%F{red}✘ %?)
elif [ "$POWERLINE_RIGHT_A" = "date" ]; then
POWERLINE_RIGHT_A="$POWERLINE_DATE_FORMAT"
fi
if [ "$POWERLINE_SHORT_HOST_NAME" = "" ]; then
POWERLINE_HOST_NAME="%M"
else
POWERLINE_HOST_NAME="%m"
fi
if [ "$POWERLINE_HIDE_USER_NAME" = "" ] && [ "$POWERLINE_HIDE_HOST_NAME" = "" ]; then
POWERLINE_USER_NAME="%n@$POWERLINE_HOST_NAME"
elif [ "$POWERLINE_HIDE_USER_NAME" != "" ] && [ "$POWERLINE_HIDE_HOST_NAME" = "" ]; then
POWERLINE_USER_NAME="@$POWERLINE_HOST_NAME"
elif [ "$POWERLINE_HIDE_USER_NAME" = "" ] && [ "$POWERLINE_HIDE_HOST_NAME" != "" ]; then
POWERLINE_USER_NAME="%n"
else
POWERLINE_USER_NAME=""
fi
if [ "$POWERLINE_PATH" = "full" ]; then
POWERLINE_PATH="%1~"
elif [ "$POWERLINE_PATH" = "short" ]; then
POWERLINE_PATH="%~"
else
POWERLINE_PATH="%d"
fi
if [ "$POWERLINE_CUSTOM_CURRENT_PATH" != "" ]; then
POWERLINE_CURRENT_PATH="$POWERLINE_CUSTOM_CURRENT_PATH"
fi
if [ "$POWERLINE_GIT_CLEAN" = "" ]; then
POWERLINE_GIT_CLEAN="✔"
fi
if [ "$POWERLINE_GIT_DIRTY" = "" ]; then
POWERLINE_GIT_DIRTY="✘"
fi
if [ "$POWERLINE_GIT_ADDED" = "" ]; then
POWERLINE_GIT_ADDED="%F{green}✚%F{black}"
fi
if [ "$POWERLINE_GIT_MODIFIED" = "" ]; then
POWERLINE_GIT_MODIFIED="%F{blue}✹%F{black}"
fi
if [ "$POWERLINE_GIT_DELETED" = "" ]; then
POWERLINE_GIT_DELETED="%F{red}✖%F{black}"
fi
if [ "$POWERLINE_GIT_UNTRACKED" = "" ]; then
POWERLINE_GIT_UNTRACKED="%F{yellow}✭%F{black}"
fi
if [ "$POWERLINE_GIT_RENAMED" = "" ]; then
POWERLINE_GIT_RENAMED="➜"
fi
if [ "$POWERLINE_GIT_UNMERGED" = "" ]; then
POWERLINE_GIT_UNMERGED="═"
fi
if [ "$POWERLINE_RIGHT_A_COLOR_FRONT" = "" ]; then
POWERLINE_RIGHT_A_COLOR_FRONT="white"
fi
if [ "$POWERLINE_RIGHT_A_COLOR_BACK" = "" ]; then
POWERLINE_RIGHT_A_COLOR_BACK="black"
fi
ZSH_THEME_GIT_PROMPT_PREFIX=" \ue0a0 "
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY=" $POWERLINE_GIT_DIRTY"
ZSH_THEME_GIT_PROMPT_CLEAN=" $POWERLINE_GIT_CLEAN"
ZSH_THEME_GIT_PROMPT_ADDED=" $POWERLINE_GIT_ADDED"
ZSH_THEME_GIT_PROMPT_MODIFIED=" $POWERLINE_GIT_MODIFIED"
ZSH_THEME_GIT_PROMPT_DELETED=" $POWERLINE_GIT_DELETED"
ZSH_THEME_GIT_PROMPT_UNTRACKED=" $POWERLINE_GIT_UNTRACKED"
ZSH_THEME_GIT_PROMPT_RENAMED=" $POWERLINE_GIT_RENAMED"
ZSH_THEME_GIT_PROMPT_UNMERGED=" $POWERLINE_GIT_UNMERGED"
ZSH_THEME_GIT_PROMPT_AHEAD=" ⬆"
ZSH_THEME_GIT_PROMPT_BEHIND=" ⬇"
ZSH_THEME_GIT_PROMPT_DIVERGED=" ⬍"
# if [ "$(git_prompt_info)" = "" ]; then
# POWERLINE_GIT_INFO_LEFT=""
# POWERLINE_GIT_INFO_RIGHT=""
# else
if [ "$POWERLINE_SHOW_GIT_ON_RIGHT" = "" ]; then
if [ "$POWERLINE_HIDE_GIT_PROMPT_STATUS" = "" ]; then
POWERLINE_GIT_INFO_LEFT=" %F{blue}%K{white}"$'\ue0b0'"%F{white}%F{black}%K{white}"$'$(git_prompt_info)$(git_prompt_status)%F{white}'
else
POWERLINE_GIT_INFO_LEFT=" %F{blue}%K{white}"$'\ue0b0'"%F{white}%F{black}%K{white}"$'$(git_prompt_info)%F{white}'
fi
POWERLINE_GIT_INFO_RIGHT=""
else
POWERLINE_GIT_INFO_LEFT=""
if [ "$POWERLINE_HIDE_GIT_PROMPT_STATUS" = "" ]; then
POWERLINE_GIT_INFO_RIGHT="%F{white}"$'\ue0b2'"%F{black}%K{white}"$'$(git_prompt_info)$(git_prompt_status)'" %K{white}"
else
POWERLINE_GIT_INFO_RIGHT="%F{white}"$'\ue0b2'"%F{black}%K{white}"$'$(git_prompt_info)'" %K{white}"
fi
fi
# fi
if [ $(id -u) -eq 0 ]; then
POWERLINE_SEC1_BG=%K{red}
POWERLINE_SEC1_FG=%F{red}
else
POWERLINE_SEC1_BG=%K{green}
POWERLINE_SEC1_FG=%F{green}
fi
POWERLINE_SEC1_TXT=%F{black}
if [ "$POWERLINE_DETECT_SSH" != "" ]; then
if [ -n "$SSH_CLIENT" ]; then
POWERLINE_SEC1_BG=%K{red}
POWERLINE_SEC1_FG=%F{red}
POWERLINE_SEC1_TXT=%F{white}
fi
fi
if [ "$VIRTUAL_ENV" != "" ] && [ "$POWERLINE_HIDE_VIRTUAL_ENV" = "" ]; then
VENV_NAME=$(basename "$VIRTUAL_ENV")
VENV_STATUS="($POWERLINE_SEC1_TXT$VENV_NAME)"
else
VENV_STATUS=""
fi
PROMPT="$POWERLINE_SEC1_BG$POWERLINE_SEC1_TXT $POWERLINE_USER_NAME $VENV_STATUS%k%f$POWERLINE_SEC1_FG%K{blue}"$'\ue0b0'"%k%f%F{white}%K{blue} "$POWERLINE_PATH"%F{blue}"$POWERLINE_GIT_INFO_LEFT" %k"$'\ue0b0'"%f "
if [ "$POWERLINE_NO_BLANK_LINE" = "" ]; then
PROMPT="
"$PROMPT
fi
if [ "$POWERLINE_DISABLE_RPROMPT" = "" ]; then
if [ "$POWERLINE_RIGHT_A" = "" ]; then
RPROMPT="$POWERLINE_GIT_INFO_RIGHT%F{white}"$'\ue0b2'"%k%F{black}%K{white} $POWERLINE_RIGHT_B %f%k"
elif [ "$POWERLINE_RIGHT_B" = "" ]; then
RPROMPT="$POWERLINE_GIT_INFO_RIGHT%F{white}"$'\ue0b2'"%k%F{$POWERLINE_RIGHT_A_COLOR_FRONT}%K{$POWERLINE_RIGHT_A_COLOR_BACK} $POWERLINE_RIGHT_A %f%k"
else
RPROMPT="$POWERLINE_GIT_INFO_RIGHT%F{white}"$'\ue0b2'"%k%F{black}%K{white} $POWERLINE_RIGHT_B %f%F{$POWERLINE_RIGHT_A_COLOR_BACK}"$'\ue0b2'"%f%k%K{$POWERLINE_RIGHT_A_COLOR_BACK}%F{$POWERLINE_RIGHT_A_COLOR_FRONT} $POWERLINE_RIGHT_A %f%k"
fi
fi