├── index.html
├── assets
├── 20220614_170518_Default_Prompt.png
├── 20220614_183811_Default_Prompt_All.png
├── 20220614_182453_Full_Default_Prompt.png
└── 20220614_182501_Full_Less_Icons_Prompt.png
├── LICENSE
├── README.md
└── acenoster.zsh-theme
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/assets/20220614_170518_Default_Prompt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HimDek/Acenoster-ZSH-Theme/HEAD/assets/20220614_170518_Default_Prompt.png
--------------------------------------------------------------------------------
/assets/20220614_183811_Default_Prompt_All.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HimDek/Acenoster-ZSH-Theme/HEAD/assets/20220614_183811_Default_Prompt_All.png
--------------------------------------------------------------------------------
/assets/20220614_182453_Full_Default_Prompt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HimDek/Acenoster-ZSH-Theme/HEAD/assets/20220614_182453_Full_Default_Prompt.png
--------------------------------------------------------------------------------
/assets/20220614_182501_Full_Less_Icons_Prompt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HimDek/Acenoster-ZSH-Theme/HEAD/assets/20220614_182501_Full_Less_Icons_Prompt.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Himprakash Deka
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | acenoster.zsh-theme
3 |
A multipurpose ZSH theme
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 | ## Prerequisites:
31 |
32 | * An Unix like Operating system like Linux, MacOS, BSD, Android (Termux) etc or WSL (Windows Subsystem for Linux), cygwin or msys if you want to use in Windows.
33 | * zsh should be installed. See [how to install zsh in various platforms](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH#how-to-install-zsh-on-many-platforms).
34 | * oh-my-zsh should be installed. See [how to install oh-my-zsh](https://ohmyz.sh/#install).
35 | * You will need to install any one [Nerd font](https://www.nerdfonts.com) and use it in your terminal for this theme to render the icons correctly.
36 | * Download any of the fonts you like from [here](https://www.nerdfonts.com/font-downloads).
37 | * Extract the downloaded `.zip` file and copy its contents into a folder in either `\usr\share\fonts` or `~\.local\share\fonts`.
38 |
39 | ### How to install and use:
40 |
41 | * Make sure you are using zsh and execute any one of the following commands given below to install the acenoster theme.
42 |
43 | * using git
44 | ```
45 | git clone https://github.com/HimDek/Acenoster-ZSH-Theme.git $ZSH/custom/themes/acenoster
46 | ```
47 | * using wget
48 | ```
49 | wget https://raw.githubusercontent.com/HimDek/Acenoster-ZSH-Theme/master/acenoster.zsh-theme -O $ZSH/custom/themes/acenoster/acenoster.zsh-theme
50 | ```
51 |
52 | * Enable acenoster theme by editing the `~/.zshrc` file. In that file, change the line containing `ZSH_THEME="SomeName"` to `ZSH_THEME="acenoster/acenoster"`.
53 |
54 |
55 |
56 | ## What does it show?
57 |
58 | The following tables show which information are shown in the prompt in sequential order.
59 |
60 | * \* denotes visible only when applicable.
61 | * \*\* indicates disabled by default.
62 | * The corresponding oh-my-zsh plugin needs to be enabled in order for its info to be shown.
63 | * To disable an info, either disable its corresponding oh-my-zsh plugin, set its corresponding toggle variable to `0` or unset its corresponding format specifier variable. See [how to enable or disable oh-my-zsh plugins](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins).
64 | * The default values of toggle and format specifier variables with additional information are given [further down](#info-toggles-set-to-0-for-off-1-for-on).
65 |
66 | ### Left pre prompt:
67 |
68 |
69 |
70 | | Info |
71 | oh-my-zsh plugin |
72 | Toggle variable |
73 | Format specifier variable |
74 |
75 |
76 | | Username |
77 | |
78 | ZSH_THEME_ACENOSTER_ALWAYS_SHOW_USER |
79 | ZSH_THEME_ACENOSTER_USER_PROMPT_FORMAT |
80 |
81 |
82 | | Hostname |
83 | |
84 | ZSH_THEME_ACENOSTER_ALWAYS_SHOW_HOST |
85 | ZSH_THEME_ACENOSTER_HOST_PROMPT_FORMAT |
86 |
87 |
88 | | *AWS profile name |
89 | aws |
90 | |
91 | |
92 |
93 |
94 | | Current working directory |
95 | |
96 | |
97 | ZSH_THEME_ACENOSTER_DIR_PROMPT_FORMAT |
98 |
99 |
100 | | *git branch, tracking and local status |
101 | git-prompt |
102 | |
103 | |
104 |
105 |
106 | | ** *Mercurial branch, tracking and local status |
107 | |
108 | ZSH_THEME_ACENOSTER_SHOW_HG_PROMPT |
109 | |
110 |
111 |
112 | | *Virtual environment name |
113 | virtualenv |
114 | |
115 | |
116 |
117 |
118 |
119 | ### Right pre prompt:
120 |
121 |
122 |
123 | | Info |
124 | oh-my-zsh plugin |
125 | Toggle variable |
126 | Format specifier variable |
127 |
128 |
129 | | *Battery percentage and status |
130 | |
131 | ZSH_THEME_ACENOSTER_SHOW_BATTERY |
132 | |
133 |
134 |
135 | | *Last command execution time |
136 | |
137 | ZSH_THEME_ACENOSTER_SHOW_TIMER |
138 | |
139 |
140 |
141 | | Emoji clock |
142 | emoji-clock |
143 | |
144 | |
145 |
146 |
147 | | Digital clock |
148 | |
149 | |
150 | ZSH_THEME_ACENOSTER_CLOCK_PROMPT_TIME_FORMAT |
151 |
152 |
153 | | Calendar |
154 | |
155 | |
156 | ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_DATE_FORMAT |
157 |
158 |
159 |
160 | ### Left Prompt:
161 |
162 |
163 |
164 | | Info |
165 | oh-my-zsh plugin |
166 | Toggle variable |
167 |
168 |
169 | | *Number of background processes |
170 | |
171 | ZSH_THEME_ACENOSTER_SHOW_BACK_JOBS |
172 |
173 |
174 | | *Last command return value |
175 | |
176 | ZSH_THEME_ACENOSTER_SHOW_LAST_RETURN |
177 |
178 |
179 | | *Vi normal mode indicator |
180 | vi-mode |
181 | ZSH_THEME_ACENOSTER_SHOW_VI_MODE |
182 |
183 |
184 |
185 |
186 |
187 | ## Environment variables:
188 |
189 | Below are the default values of environment variables used by this prompt. To customize any of them, unset or set a new value in the `~/.zshrc` file.
190 |
191 | ### Info Toggles: Set to `0` for off, `1` for on.
192 |
193 | ```
194 | ZSH_THEME_ACENOSTER_ALWAYS_SHOW_USER=1
195 | ZSH_THEME_ACENOSTER_ALWAYS_SHOW_HOST=1
196 | ZSH_THEME_ACENOSTER_SHOW_HG_PROMPT=0
197 | ZSH_THEME_ACENOSTER_SHOW_BATTERY=1
198 | ZSH_THEME_ACENOSTER_SHOW_TIMER=1
199 | ZSH_THEME_ACENOSTER_SHOW_BACK_JOBS=1
200 | ZSH_THEME_ACENOSTER_SHOW_LAST_RETURN=1
201 | ZSH_THEME_ACENOSTER_SHOW_VI_MODE=1
202 | ```
203 |
204 | * See [this](#what-does-it-show) to know which is what.
205 | * Turning off `ZSH_THEME_ACENOSTER_ALWAYS_SHOW_USER` which is on by default will hide the user name unless it is root or in an SSH shell.
206 | * Turning off `ZSH_THEME_ACENOSTER_ALWAYS_SHOW_HOST` which is on by default will hide the host name unless it is in an SSH shell.
207 | * Turning on `ZSH_THEME_ACENOSTER_SHOW_HG_PROMPT` which is off by default will enable the [mercurial](https://www.mercurial-scm.org/) info of the prompt. Mercurial is a SCM (Source Control Management) tool just like git. Although not as popular as git, it is still used in many projects.
208 | * `ZSH_THEME_ACENOSTER_SHOW_BATTERY` which is on by default is the toggle for the battery capacity icon and percentage in the prompt.
209 | * `ZSH_THEME_ACENOSTER_SHOW_TIMER` which is on by default is the toggle for the timer that shows the time taken by the previous command run in the terminal.
210 | * `ZSH_THEME_ACENOSTER_SHOW_VI_MODE` which is on by default is the toggle for the Vi normal mode inicator
211 | * `ZSH_THEME_ACENOSTER_SHOW_BACK_JOBS` which is on by default is the toggle for the indicator that shows if any background process is running in the current terminal.
212 | * `ZSH_THEME_ACENOSTER_SHOW_LAST_RETURN` which is on by default is the toggle for the indicator that shows if the last command exited with a non zero return value.
213 |
214 | ### Info Format specifiers:
215 |
216 | ```
217 | ZSH_THEME_ACENOSTER_USER_PROMPT_FORMAT="%n"
218 | ZSH_THEME_ACENOSTER_HOST_PROMPT_FORMAT="%m"
219 | ZSH_THEME_ACENOSTER_DIR_PROMPT_FORMAT="%~"
220 | ZSH_THEME_ACENOSTER_CLOCK_PROMPT_TIME_FORMAT="%I:%M %P"
221 | ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_DATE_FORMAT="%a %b %d"
222 | ```
223 |
224 | * See [this](#what-does-it-show) to know which is what.
225 | * If you don't want to see any of these info in the prompt, then unset the corresponding variable by inserting a line with the command `unset variableName` into the `~/.zshrc` file.
226 |
227 | ### Settings: Set to `0` to disable, `1` to enable.
228 |
229 | ```
230 | ZSH_THEME_ACENOSTER_FLUENT_FLOW=1
231 | ZSH_THEME_ACENOSTER_LESS_ICONS=0
232 | ZSH_THEME_ACENOSTER_COMPACT=0
233 | ```
234 |
235 | * Enabling `ZSH_THEME_ACENOSTER_FLUENT_FLOW` which is enabled by default shows the connecting words like `at`, `in`, `took`, `on` etc in a dull color between different parts of the prompt to make them seem connected and unified while not being too intrusive.
236 | * Enabling `ZSH_THEME_ACENOSTER_LESS_ICONS`, which is disabled by default will show only those icons in the prompt that indicate a status.
237 | * Enabling `ZSH_THEME_ACENOSTER_COMPACT` which is disabled by default will remove the empty line before every prompt.
238 |
239 | ### Battery levels:
240 |
241 | ```
242 | ZSH_THEME_ACENOSTER_BATTERY_HIGH=80
243 | ZSH_THEME_ACENOSTER_BATTERY_LOW=40
244 | ZSH_THEME_ACENOSTER_BATTERY_CRIT=20
245 | ```
246 |
247 | ### Colors:
248 |
249 | ```
250 | COLOR_AWS="%{$FG[130]%}" # Used by the AWS icon and profile name text.
251 | COLOR_GIT="%{$FG[203]%}" # Used by the git icon and branch name text.
252 | COLOR_HG="%{$FG[244]%}" # Used by the mercurial icon and branch name text.
253 | COLOR_BATTERY_FULL="%{$FG[040]%}" # Used by the battery full icon and "100%" text.
254 | COLOR_BATTERY_NORMAL="%{$fg[cyan]%}"
255 | COLOR_DULL="%{$fg[black]%}"
256 | COLOR_RED="%{$fg[red]%}"
257 | COLOR_GREEN="%{$fg[green]%}"
258 | COLOR_BLUE="%{$fg[blue]%}"
259 | COLOR_YELLOW="%{$fg[yellow]%}"
260 | COLOR_RESET="%{$reset_color%}"
261 | ```
262 | * `COLOR_BATTERY_NORMAL` is the color used by the battery icon and percentage text when it is between the values of `ZSH_THEME_ACENOSTER_BATTERY_HIGH` and `ZSH_THEME_ACENOSTER_BATTERY_LOW` as set in [Battery levels](#battery-levels) section.
263 | * `COLOR_DULL` is the color used by the connecting words like `at`, `in`, `took`, `on` etc shown between different parts of the prompt when `ZSH_THEME_ACENOSTER_FLUENT_FLOW` is enabled as described [here](#settings-set-to-0-to-disable-1-to-enable).
264 | * Other colors are used by several parts of the prompt to indicate different states in general.
265 |
266 |
267 |
268 | Gallery
269 |
270 |
271 |
272 |
273 |
274 | ▲ Default prompt showing all possible information
275 |
276 |
277 |
278 |
279 |
280 |
281 | ▲ Same as above but with ZSH_THEME_ACENOSTER_LESS_ICONS turned on:
282 |
283 |
--------------------------------------------------------------------------------
/acenoster.zsh-theme:
--------------------------------------------------------------------------------
1 | # Acenoster ZSH Theme: A multipurpose ZSH theme.
2 | # Much of the original codebase was copied from oh-my-zsh's agnoster theme (https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/agnoster.zsh-theme) and other oh-my-zsh themes and plugins.
3 | # Visually simillar to oh-my-zsh's fino theme (https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/fino.zsh-theme)
4 |
5 | TERMINAL=$(basename "/"$(ps -o cmd -f -p $(cat /proc/$(echo $$)/stat | cut -d \ -f 4) | tail -1 | sed 's/ .*$//'))
6 |
7 | # Toggles: Set to 0 for off, 1 for on.
8 | ZSH_THEME_ACENOSTER_ALWAYS_SHOW_USER=1
9 | ZSH_THEME_ACENOSTER_ALWAYS_SHOW_HOST=1
10 | ZSH_THEME_ACENOSTER_SHOW_HG_PROMPT=0
11 | ZSH_THEME_ACENOSTER_SHOW_BATTERY=1
12 | ZSH_THEME_ACENOSTER_SHOW_TIMER=1
13 | ZSH_THEME_ACENOSTER_SHOW_BACK_JOBS=1
14 | ZSH_THEME_ACENOSTER_SHOW_LAST_RETURN=1
15 | ZSH_THEME_ACENOSTER_SHOW_VI_MODE=1
16 | ZSH_THEME_ACENOSTER_FLUENT_FLOW=1
17 | ZSH_THEME_ACENOSTER_LESS_ICONS=0
18 | ZSH_THEME_ACENOSTER_COMPACT=0
19 |
20 | VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true
21 | VI_MODE_SET_CURSOR=true
22 |
23 | # Battery levels:
24 | ZSH_THEME_ACENOSTER_BATTERY_HIGH=80
25 | ZSH_THEME_ACENOSTER_BATTERY_LOW=40
26 | ZSH_THEME_ACENOSTER_BATTERY_CRIT=20
27 |
28 | # Icons:
29 | # Runs before every prompt
30 | acenoster_update_icons () {
31 | if [[ $TERMINAL = "login" ]]; then
32 | # Since tty can not display emoticon icons, some essential icons are replaced with legacy characters for it.
33 | AT_ICON="@"
34 | AWS_SYMBOL="AWS:"
35 |
36 | PLUS_ICON="+"
37 | DELETED_ICON="×"
38 | REMOVED_ICON="-"
39 | CHECKMARK_ICON="•"
40 | UNKNOWN_ICON="?"
41 | BANG_ICON="!"
42 | STASH_ICON="…"
43 | DOWN_ICON="↓"
44 | UP_ICON="↑"
45 |
46 | SHOCK_ICON="⌁"
47 |
48 | GEAR_ICON="B"
49 | WRONG_ICON="×"
50 | PROMPT_CHAR="O "
51 | else
52 | : ${AT_ICON="\uf1fa"}
53 | : ${AWS_SYMBOL="\uf0ef"}
54 |
55 | : ${PLUS_ICON="\uf055"}
56 | : ${DELETED_ICON="\uf057"}
57 | : ${REMOVED_ICON="\uf056"}
58 | : ${CHECKMARK_ICON="\uf058"}
59 | : ${UNKNOWN_ICON="\uf059"}
60 | : ${BANG_ICON="\uf06a"}
61 | : ${STASH_ICON="\uf01c"}
62 | : ${DOWN_ICON="\uf0ab"}
63 | : ${UP_ICON="\uf0aa"}
64 |
65 | : ${BATTERY_100_ICON=" "}
66 | : ${BATTERY_90_ICON=" "}
67 | : ${BATTERY_80_ICON=" "}
68 | : ${BATTERY_70_ICON=" "}
69 | : ${BATTERY_60_ICON=" "}
70 | : ${BATTERY_50_ICON=" "}
71 | : ${BATTERY_40_ICON=" "}
72 | : ${BATTERY_30_ICON=" "}
73 | : ${BATTERY_20_ICON=" "}
74 | : ${BATTERY_10_ICON=" "}
75 | : ${BATTERY_0_ICON=" "}
76 | : ${SHOCK_ICON="\uf0e7 "}
77 |
78 | : ${GEAR_ICON="\uf013"}
79 | : ${WRONG_ICON="\uf468"}
80 | : ${PROMPT_CHAR="\ueabc "}
81 | : ${VIM_ICON="\ue7c5 "}
82 | fi
83 |
84 | if [[ $ZSH_THEME_ACENOSTER_LESS_ICONS -eq 0 ]]; then
85 | # Non essential or decorative icons:
86 | : ${ROOT_USER_ICON="\uf292 "}
87 | : ${USER_ICON="\uf2bd "}
88 | : ${HOST_ICON="\uf108 "}
89 | : ${DIR_ICON="\uf4d4 "}
90 |
91 | : ${GIT_ICON=" "}
92 | : ${HG_ICON="\uf223 "}
93 |
94 | : ${EXE_TIME_ICON="\uf2f2 "}
95 | : ${CALENDAR_ICON="\uef37 "}
96 | else
97 | unset ROOT_USER_ICON USER_ICON HOST_ICON DIR_ICON GIT_ICON HG_ICON EXE_TIME_ICON CALENDAR_ICON
98 | fi
99 | }
100 |
101 | # Colors:
102 | COLOR_AWS="%{$FG[130]%}" # Used by the AWS icon and profile name text.
103 | COLOR_GIT="%{$FG[203]%}" # Used by the git icon and branch name text.
104 | COLOR_HG="%{$FG[244]%}" # Used by the mercurial icon and branch name text.
105 | COLOR_BATTERY_FULL="%{$FG[040]%}" # Used by the battery full icon and "100%" text.
106 | COLOR_BATTERY_NORMAL="%{$fg[cyan]%}"
107 | COLOR_DULL="%{$fg[black]%}"
108 | COLOR_RED="%{$fg[red]%}"
109 | COLOR_GREEN="%{$fg[green]%}"
110 | COLOR_BLUE="%{$fg[blue]%}"
111 | COLOR_YELLOW="%{$fg[yellow]%}"
112 | COLOR_RESET="%{$reset_color%}"
113 |
114 | # Format options:
115 | ZSH_THEME_ACENOSTER_USER_PROMPT_FORMAT="%n"
116 | ZSH_THEME_ACENOSTER_HOST_PROMPT_FORMAT="%m"
117 | ZSH_THEME_ACENOSTER_DIR_PROMPT_FORMAT="%~"
118 | ZSH_THEME_ACENOSTER_CLOCK_PROMPT_TIME_FORMAT="%I:%M %P"
119 | ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_DATE_FORMAT="%a %d %b"
120 |
121 | # Appearance:
122 | acenoster_update_icons
123 |
124 | ZSH_THEME_ACENOSTER_USER_PROMPT_PREFIX="$COLOR_GREEN$USER_ICON"
125 | ZSH_THEME_ACENOSTER_USER_PROMPT_SUFFIX=""
126 | ZSH_THEME_ACENOSTER_ROOT_USER_PROMPT_PREFIX="$COLOR_RED$ROOT_USER_ICON"
127 | ZSH_THEME_ACENOSTER_ROOT_USER_PROMPT_SUFFIX="$ZSH_THEME_ACENOSTER_USER_SUFFIX"
128 |
129 | ZSH_THEME_ACENOSTER_HOST_PROMPT_PREFIX="$COLOR_DULL$AT_ICON$COLOR_BLUE"
130 | ZSH_THEME_ACENOSTER_HOST_PROMPT_SUFFIX=""
131 |
132 | ZSH_THEME_AWS_PREFIX=" $COLOR_AWS$AWS_SYMBOL "
133 | ZSH_THEME_AWS_SUFFIX=""
134 |
135 | ZSH_THEME_ACENOSTER_DIR_PROMPT_PREFIX=" $DIR_ICON"
136 | ZSH_THEME_ACENOSTER_DIR_PROMPT_SUFFIX=""
137 |
138 | ZSH_THEME_GIT_PROMPT_PREFIX=""
139 | ZSH_THEME_GIT_PROMPT_SUFFIX=""
140 | ZSH_THEME_GIT_PROMPT_SEPARATOR=""
141 | ZSH_THEME_GIT_PROMPT_BRANCH=" $COLOR_GIT$GIT_ICON"
142 | ZSH_THEME_GIT_PROMPT_BEHIND=" $COLOR_RED$DOWN_ICON:"
143 | ZSH_THEME_GIT_PROMPT_AHEAD=" $COLOR_BLUE$UP_ICON:"
144 | ZSH_THEME_GIT_PROMPT_STAGED=" $COLOR_GREEN$PLUS_ICON:"
145 | ZSH_THEME_GIT_PROMPT_CONFLICTS=" $COLOR_RED$BANG_ICON:"
146 | ZSH_THEME_GIT_PROMPT_CHANGED=" $COLOR_YELLOW$PLUS_ICON:"
147 | ZSH_THEME_GIT_PROMPT_UNTRACKED=" $COLOR_RED$UNKNOWN_ICON:"
148 | ZSH_THEME_GIT_PROMPT_STASHED=" $COLOR_BLUE$STASH_ICON:"
149 | ZSH_THEME_GIT_PROMPT_CLEAN=" $COLOR_GREEN$CHECKMARK_ICON"
150 |
151 | ZSH_THEME_HG_PROMPT_PREFIX="$ZSH_THEME_GIT_PROMPT_PREFIX"
152 | ZSH_THEME_HG_PROMPT_SUFFIX="$ZSH_THEME_GIT_PROMPT_SUFFIX"
153 | ZSH_THEME_HG_PROMPT_SEPARATOR="$ZSH_THEME_GIT_PROMPT_SEPARATOR"
154 | ZSH_THEME_HG_PROMPT_BRANCH=" $COLOR_HG$HG_ICON"
155 | ZSH_THEME_HG_PROMPT_BEHIND="$ZSH_THEME_GIT_PROMPT_BEHIND"
156 | ZSH_THEME_HG_PROMPT_AHEAD="$ZSH_THEME_GIT_PROMPT_AHEAD"
157 | ZSH_THEME_HG_PROMPT_MODIFIED=" $COLOR_GREEN$PLUS_ICON:"
158 | ZSH_THEME_HG_PROMPT_ADDED=" $COLOR_YELLOW$PLUS_ICON:"
159 | ZSH_THEME_HG_PROMPT_REMOVED=" $COLOR_YELLOW$REMOVED_ICON:"
160 | ZSH_THEME_HG_PROMPT_DELETED=" $COLOR_RED$DELETED_ICON:"
161 | ZSH_THEME_HG_PROMPT_UNKNOWN="$ZSH_THEME_GIT_PROMPT_UNTRACKED"
162 | ZSH_THEME_HG_PROMPT_CLEAN="$ZSH_THEME_GIT_PROMPT_CLEAN"
163 |
164 | ZSH_THEME_VIRTUALENV_PREFIX=" ["
165 | ZSH_THEME_VIRTUALENV_SUFFIX="] "
166 |
167 | ZSH_THEME_ACENOSTER_TIMER_PROMPT_PREFIX=" $COLOR_BLUE$EXE_TIME_ICON"
168 | ZSH_THEME_ACENOSTER_TIMER_PROMPT_SUFFIX=""
169 |
170 | ZSH_THEME_ACENOSTER_EMOJI_CLOCK_PROMPT_PREFIX=" "
171 | ZSH_THEME_ACENOSTER_EMOJI_CLOCK_PROMPT_SUFFIX=""
172 |
173 | ZSH_THEME_ACENOSTER_CLOCK_PROMPT_PREFIX=""
174 | ZSH_THEME_ACENOSTER_CLOCK_PROMPT_SUFFIX=""
175 |
176 | ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_PREFIX=" $CALENDAR_ICON"
177 | ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_SUFFIX=""
178 |
179 | ZSH_THEME_ACENOSTER_BACK_JOB_PROMPT_PREFIX="<$COLOR_BLUE$GEAR_ICON:"
180 | ZSH_THEME_ACENOSTER_BACK_JOB_PROMPT_SUFFIX=">─"
181 |
182 | ZSH_THEME_ACENOSTER_STRING_PROMPT="$COLOR_GREEN$PROMPT_CHAR"
183 | ZSH_THEME_ACENOSTER_ERROR_STRING_PROMPT_PREFIX="<$COLOR_RED$WRONG_ICON:"
184 | ZSH_THEME_ACENOSTER_ERROR_STRING_PROMPT_SUFFIX=">─"
185 |
186 | ZSH_THEME_ACENOSTER_VI_MODE_PROMPT_PREFIX=""
187 | ZSH_THEME_ACENOSTER_VI_MODE_PROMPT_SUFIX=""
188 | MODE_INDICATOR="$COLOR_RED$VIM_ICON$COLOR_RESET"
189 | INSERT_MODE_INDICATOR="$ZSH_THEME_ACENOSTER_STRING_PROMPT"
190 |
191 | # Runs before every prompt
192 | acenoster_update_appearance () {
193 | # : ${ZSH_THEME_*_PREFIX_NON_FLUENT=$ZSH_THEME_*_PREFIX}
194 | : ${ZSH_THEME_ACENOSTER_HOST_PROMPT_PREFIX_NON_FLUENT=$ZSH_THEME_ACENOSTER_HOST_PROMPT_PREFIX}
195 | : ${ZSH_THEME_ACENOSTER_DIR_PROMPT_PREFIX_NON_FLUENT=$ZSH_THEME_ACENOSTER_DIR_PROMPT_PREFIX}
196 | : ${ZSH_THEME_GIT_PROMPT_PREFIX_NON_FLUENT=$ZSH_THEME_GIT_PROMPT_PREFIX}
197 | : ${ZSH_THEME_HG_PROMPT_PREFIX_NON_FLUENT=$ZSH_THEME_HG_PROMPT_PREFIX}
198 | : ${ZSH_THEME_VIRTUALENV_PREFIX_NON_FLUENT=$ZSH_THEME_VIRTUALENV_PREFIX}
199 | : ${ZSH_THEME_ACENOSTER_TIMER_PROMPT_PREFIX_NON_FLUENT=$ZSH_THEME_ACENOSTER_TIMER_PROMPT_PREFIX}
200 | : ${ZSH_THEME_ACENOSTER_EMOJI_CLOCK_PROMPT_PREFIX_NON_FLUENT=$ZSH_THEME_ACENOSTER_EMOJI_CLOCK_PROMPT_PREFIX}
201 | : ${ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_PREFIX_NON_FLUENT=$ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_PREFIX}
202 |
203 | # ZSH_THEME_*_PREFIX=$ZSH_THEME_*_PREFIX_NON_FLUENT
204 | ZSH_THEME_ACENOSTER_HOST_PROMPT_PREFIX=$ZSH_THEME_ACENOSTER_HOST_PROMPT_PREFIX_NON_FLUENT
205 | [[ $ZSH_THEME_ACENOSTER_ALWAYS_SHOW_USER -eq 1 || $ZSH_THEME_ACENOSTER_ALWAYS_SHOW_HOST -eq 1 ]] && ZSH_THEME_ACENOSTER_DIR_PROMPT_PREFIX=" $ZSH_THEME_ACENOSTER_DIR_PROMPT_PREFIX_NON_FLUENT" || ZSH_THEME_ACENOSTER_DIR_PROMPT_PREFIX=$ZSH_THEME_ACENOSTER_DIR_PROMPT_PREFIX_NON_FLUENT
206 | ZSH_THEME_GIT_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX_NON_FLUENT
207 | ZSH_THEME_HG_PROMPT_PREFIX=$ZSH_THEME_HG_PROMPT_PREFIX_NON_FLUENT
208 | ZSH_THEME_VIRTUALENV_PREFIX=$ZSH_THEME_VIRTUALENV_PREFIX_NON_FLUENT
209 | ZSH_THEME_ACENOSTER_TIMER_PROMPT_PREFIX=$ZSH_THEME_ACENOSTER_TIMER_PROMPT_PREFIX_NON_FLUENT
210 | ZSH_THEME_ACENOSTER_EMOJI_CLOCK_PROMPT_PREFIX=$ZSH_THEME_ACENOSTER_EMOJI_CLOCK_PROMPT_PREFIX_NON_FLUENT
211 | ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_PREFIX=$ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_PREFIX_NON_FLUENT
212 |
213 | if [[ $ZSH_THEME_ACENOSTER_FLUENT_FLOW -eq 1 ]]; then
214 | [[ $ZSH_THEME_ACENOSTER_ALWAYS_SHOW_USER -eq 1 ]] && ZSH_THEME_ACENOSTER_HOST_PROMPT_PREFIX="$COLOR_DULL at$COLOR_RESET $COLOR_BLUE$HOST_ICON"
215 | [[ $ZSH_THEME_ACENOSTER_ALWAYS_SHOW_USER -eq 1 || $ZSH_THEME_ACENOSTER_ALWAYS_SHOW_HOST -eq 1 ]] && ZSH_THEME_ACENOSTER_DIR_PROMPT_PREFIX="$COLOR_DULL in$COLOR_RESET$ZSH_THEME_ACENOSTER_DIR_PROMPT_PREFIX"
216 | ZSH_THEME_GIT_PROMPT_PREFIX="$COLOR_DULL on$COLOR_RESET$ZSH_THEME_GIT_PROMPT_PREFIX"
217 | ZSH_THEME_HG_PROMPT_PREFIX="$ZSH_THEME_GIT_PROMPT_PREFIX"
218 | ZSH_THEME_VIRTUALENV_PREFIX="$COLOR_DULL using$COLOR_RESET$ZSH_THEME_VIRTUALENV_PREFIX"
219 | ZSH_THEME_ACENOSTER_TIMER_PROMPT_PREFIX="$COLOR_DULL took$COLOR_RESET$ZSH_THEME_ACENOSTER_TIMER_PROMPT_PREFIX"
220 | ZSH_THEME_ACENOSTER_EMOJI_CLOCK_PROMPT_PREFIX="$COLOR_DULL at$COLOR_RESET$ZSH_THEME_ACENOSTER_EMOJI_CLOCK_PROMPT_PREFIX"
221 | ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_PREFIX="$COLOR_DULL on$COLOR_RESET$ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_PREFIX"
222 | fi
223 | }
224 |
225 | # Username
226 | acenoster_prompt_user () {
227 | [[ -z $ZSH_THEME_ACENOSTER_USER_PROMPT_FORMAT ]] && return
228 | if [[ $EUID -eq 0 ]]; then
229 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_ROOT_USER_PROMPT_PREFIX$ZSH_THEME_ACENOSTER_USER_PROMPT_FORMAT$COLOR_RESET$ZSH_THEME_ACENOSTER_ROOT_USER_PROMPT_SUFFIX$COLOR_RESET"
230 | elif [[ $ZSH_THEME_ACENOSTER_ALWAYS_SHOW_USER != 0 || -n "$SSH_CLIENT" ]]; then
231 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_USER_PROMPT_PREFIX$ZSH_THEME_ACENOSTER_USER_PROMPT_FORMAT$COLOR_RESET$ZSH_THEME_ACENOSTER_USER_PROMPT_SUFFIX$COLOR_RESET"
232 | fi
233 | }
234 |
235 | # Hostname
236 | acenoster_prompt_host () {
237 | [[ -z $ZSH_THEME_ACENOSTER_HOST_PROMPT_FORMAT ]] && return
238 | [[ $ZSH_THEME_ACENOSTER_ALWAYS_SHOW_HOST -eq 0 && -z "$SSH_CLIENT" ]] && return
239 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_HOST_PROMPT_PREFIX$ZSH_THEME_ACENOSTER_HOST_PROMPT_FORMAT$COLOR_RESET$ZSH_THEME_ACENOSTER_HOST_PROMPT_SUFFIX$COLOR_RESET"
240 | }
241 |
242 | # AWS Profile
243 | acenoster_aws_prompt_info () {
244 | ! type aws_prompt_info > /dev/null && return
245 | echo "$COLOR_RESET$(aws_prompt_info)$COLOR_RESET"
246 | }
247 |
248 | # Current Working Directory
249 | acenoster_prompt_dir () {
250 | [[ -z $ZSH_THEME_ACENOSTER_DIR_PROMPT_FORMAT ]] && return
251 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_DIR_PROMPT_PREFIX$COLOR_RESET$ZSH_THEME_ACENOSTER_DIR_PROMPT_FORMAT$COLOR_RESET$ZSH_THEME_ACENOSTER_DIR_PROMPT_SUFFIX$COLOR_RESET"
252 | }
253 |
254 | # git branch, tracking and local status
255 | acenoster_git_super_status () {
256 | ! type git_super_status > /dev/null && return
257 | echo "$COLOR_RESET$(git_super_status)$COLOR_RESET"
258 | }
259 |
260 | # Mercurial branch, tracking and local status
261 | acenoster_prompt_hg () {
262 | [[ $ZSH_THEME_ACENOSTER_SHOW_HG_PROMPT = 0 ]] && return
263 | [[ $+commands[hg] ]] || return
264 | if $(hg id >/dev/null 2>&1); then ; else return; fi
265 | local rev="$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g')"
266 | local branch="$(hg id -b 2>/dev/null)"
267 | local hg_status=`hg st`
268 | local hg_rev_branch="${rev:gs/%/%%}@${branch:gs/%/%%}"
269 | local hg_unknown="$(echo $hg_status | grep "^\?" | wc -l)"
270 | local hg_modified="$(echo $hg_status | grep "^\M" | wc -l)"
271 | local hg_added="$(echo $hg_status | grep "^\A" | wc -l)"
272 | local hg_removed="$(echo $hg_status | grep "^\R" | wc -l)"
273 | local hg_deleted="$(echo $hg_status | grep "^\!" | wc -l)"
274 | local hg_ahead="$(hg log -r "draft()" | grep "summary" | wc -l)"
275 | # local hg_behind="$(hg incoming | grep "summary" | wc -l)"
276 |
277 | local hg_status="%{${reset_color}%}$ZSH_THEME_HG_PROMPT_PREFIX%{${reset_color}%}$ZSH_THEME_HG_PROMPT_BRANCH$hg_rev_branch%{${reset_color}%}"
278 | if [[ "$hg_behind" -ne "0" ]]; then
279 | hg_status="$hg_status$ZSH_THEME_HG_PROMPT_BEHIND$hg_behind%{$reset_color%}"
280 | fi
281 | if [[ "$hg_ahead" -ne "0" ]]; then
282 | hg_status="$hg_status$ZSH_THEME_HG_PROMPT_AHEAD$hg_ahead%{$reset_color%}"
283 | fi
284 | hg_status="$hg_status$ZSH_THEME_HG_PROMPT_SEPARATOR"
285 | if [[ "$hg_modified" -ne "0" ]]; then
286 | hg_status="$hg_status$ZSH_THEME_HG_PROMPT_MODIFIED$hg_modified%{$reset_color%}"
287 | fi
288 | if [[ "$hg_added" -ne "0" ]]; then
289 | hg_status="$hg_status$ZSH_THEME_HG_PROMPT_ADDED$hg_added%{$reset_color%}"
290 | fi
291 | if [[ "$hg_removed" -ne "0" ]]; then
292 | hg_status="$hg_status$ZSH_THEME_HG_PROMPT_REMOVED$hg_removed%{$reset_color%}"
293 | fi
294 | if [[ "$hg_deleted" -ne "0" ]]; then
295 | hg_status="$hg_status$ZSH_THEME_HG_PROMPT_DELETED$hg_deleted%{$reset_color%}"
296 | fi
297 | if [[ "$hg_unknown" -ne "0" ]]; then
298 | hg_status="$hg_status$ZSH_THEME_HG_PROMPT_UNKNOWN$hg_unknown%{$reset_color%}"
299 | fi
300 | if [[ "$hg_modified" -eq "0" && "$hg_added" -eq "0" && "$hg_removed" -eq "0" && "$hg_deleted" -eq "0" && "$hg_unknown" -eq "0" ]]; then
301 | hg_status="$hg_status$ZSH_THEME_HG_PROMPT_CLEAN%{${reset_color}%}"
302 | fi
303 | hg_status="$hg_status$ZSH_THEME_HG_PROMPT_SUFFIX%{${reset_color}%}"
304 | echo "$hg_status"
305 | }
306 |
307 | # Virtual environment name
308 | acenoster_virtualenv_prompt_info () {
309 | ! type virtualenv_prompt_info > /dev/null && return
310 | echo "$COLOR_RESET$(virtualenv_prompt_info)$COLOR_RESET"
311 | }
312 |
313 | # Battery percentage and status
314 | acenoster_prompt_battery () {
315 | [[ $ZSH_THEME_ACENOSTER_SHOW_BATTERY -eq 0 ]] && return
316 | (( $+commands[acpi] )) || return
317 | if [[ $OSTYPE = linux* ]]; then
318 | local out col="$COLOR_BATTERY_NORMAL" bat=$(echo $(echo -e "$(upower -i $(upower -e | grep BAT) | grep "percentage" | grep -o "[0-9]*.[0-9]*%")\b ") | awk '{print int($1 + 0.5)}')
319 | if [[ "$(upower -i $(upower -e | grep BAT) | grep "state" | grep -o "discharging")" != "discharging" ]]; then
320 | out="$COLOR_YELLOW$SHOCK_ICON$COLOR_RESET"
321 | if [[ $bat -ge $ZSH_THEME_ACENOSTER_BATTERY_HIGH ]]; then
322 | col="$COLOR_GREEN"
323 | fi
324 | elif [[ $bat -eq 100 ]]; then
325 | out="$COLOR_YELLOW$SHOCK_ICON$COLOR_RESET"
326 | col="$COLOR_BATTERY_FULL"
327 | elif [[ $bat -ge $ZSH_THEME_ACENOSTER_BATTERY_HIGH ]]; then
328 | col="$COLOR_GREEN"
329 | elif [[ $bat -gt $ZSH_THEME_ACENOSTER_BATTERY_CRIT && $bat -le $ZSH_THEME_ACENOSTER_BATTERY_LOW ]]; then
330 | col="$COLOR_YELLOW"
331 | elif [[ $bat -le $ZSH_THEME_ACENOSTER_BATTERY_CRIT ]]; then
332 | col="$COLOR_RED"
333 | fi
334 |
335 | if [[ $bat -gt 95 || $bat -eq 100 ]]; then
336 | out+="$col$BATTERY_100_ICON$bat%%%%$COLOR_RESET"
337 | elif [[ $bat -lt 96 && $bat -gt 85 ]]; then
338 | out+="$col$BATTERY_90_ICON$bat%%%%$COLOR_RESET"
339 | elif [[ $bat -lt 86 && $bat -gt 75 ]]; then
340 | out+="$col$BATTERY_80_ICON$bat%%%%$COLOR_RESET"
341 | elif [[ $bat -lt 76 && $bat -gt 65 ]]; then
342 | out+="$col$BATTERY_70_ICON$bat%%%%$COLOR_RESET"
343 | elif [[ $bat -lt 66 && $bat -gt 55 ]]; then
344 | out+="$col$BATTERY_60_ICON$bat%%%%$COLOR_RESET"
345 | elif [[ $bat -lt 56 && $bat -gt 45 ]]; then
346 | out+="$col$BATTERY_50_ICON$bat%%%%$COLOR_RESET"
347 | elif [[ $bat -lt 46 && $bat -gt 35 ]]; then
348 | out+="$col$BATTERY_40_ICON$bat%%%%$COLOR_RESET"
349 | elif [[ $bat -lt 36 && $bat -gt 25 ]]; then
350 | out+="$col$BATTERY_30_ICON$bat%%%%$COLOR_RESET"
351 | elif [[ $bat -lt 26 && $bat -gt 15 ]]; then
352 | out+="$col$BATTERY_20_ICON$bat%%%%$COLOR_RESET"
353 | elif [[ $bat -lt 16 && $bat -gt 5 ]]; then
354 | out+="$col$BATTERY_10_ICON$bat%%%%$COLOR_RESET"
355 | else
356 | out+="$col$BATTERY_0_ICON$bat%%%%$COLOR_RESET"
357 | fi
358 | echo " $out"
359 | fi
360 | }
361 |
362 | # Last command execution time
363 | acenoster_prompt_timer () {
364 | [[ $ZSH_THEME_ACENOSTER_SHOW_TIMER = 0 ]] && return
365 | [[ -z "${TIMER_CMD_START_TIME}" ]] && return
366 | local tdiff=$((TIMER_CMD_END_TIME - TIMER_CMD_START_TIME))
367 | [[ -n "${TIMER_THRESHOLD}" && ${tdiff} -lt "${TIMER_THRESHOLD}" ]] && return
368 | local tdiffstr=$(timer_format_duration ${tdiff})
369 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_TIMER_PROMPT_PREFIX${tdiffstr}$COLOR_RESET$ZSH_THEME_ACENOSTER_TIMER_PROMPT_SUFFIX$COLOR_RESET"
370 | }
371 |
372 | # Emoji clock
373 | acenoster_emoji-clock () {
374 | ! type emoji-clock > /dev/null && return
375 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_EMOJI_CLOCK_PROMPT_PREFIX$(emoji-clock)$COLOR_RESET$ZSH_THEME_ACENOSTER_EMOJI_CLOCK_PROMPT_SUFFIX$COLOR_RESET"
376 | }
377 |
378 | # Digital clock
379 | acenoster_prompt_clock () {
380 | [[ -z $ZSH_THEME_ACENOSTER_CLOCK_PROMPT_TIME_FORMAT ]] && return
381 | local time="$(date "+$ZSH_THEME_ACENOSTER_CLOCK_PROMPT_TIME_FORMAT")"
382 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_CLOCK_PROMPT_PREFIX$time$COLOR_RESET$ZSH_THEME_ACENOSTER_CLOCK_PROMPT_SUFFIX$COLOR_RESET"
383 | }
384 |
385 | # Calendar
386 | acenoster_prompt_calendar () {
387 | [[ -z $ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_DATE_FORMAT ]] && return
388 | local date="$(date "+$ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_DATE_FORMAT")"
389 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_PREFIX$date$COLOR_RESET$ZSH_THEME_ACENOSTER_CALENDAR_PROMPT_SUFFIX$COLOR_RESET"
390 | }
391 |
392 | # Number of background processes
393 | acenoster_prompt_back_task () {
394 | [[ $ZSH_THEME_ACENOSTER_SHOW_BACK_JOBS -eq 0 ]] && return
395 | [[ $BACKGROUND_TASKS -eq "0" ]] && return
396 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_BACK_JOB_PROMPT_PREFIX$BACKGROUND_TASKS$COLOR_RESET$ZSH_THEME_ACENOSTER_BACK_JOB_PROMPT_SUFFIX$COLOR_RESET"
397 | }
398 |
399 | # Last command error code
400 | acenoster_prompt_exit_code () {
401 | [[ $ZSH_THEME_ACENOSTER_SHOW_LAST_RETURN -eq 0 ]] && return
402 | [[ $LAST_EXIT_CODE -eq "0" ]] && return
403 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_ERROR_STRING_PROMPT_PREFIX$LAST_EXIT_CODE$COLOR_RESET$ZSH_THEME_ACENOSTER_ERROR_STRING_PROMPT_SUFFIX$COLOR_RESET"
404 | }
405 |
406 | # Vi mode indicator
407 | acenoster_prompt_vi_mode () {
408 | [[ $ZSH_THEME_ACENOSTER_SHOW_VI_MODE -eq 0 ]] && echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_STRING_PROMPT$COLOR_RESET" && return
409 | ! type vi_mode_prompt_info > /dev/null && echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_STRING_PROMPT$COLOR_RESET" && return
410 | echo "$COLOR_RESET$ZSH_THEME_ACENOSTER_VI_MODE_PROMPT_PREFIX$COLOR_RESET$(vi_mode_prompt_info)$COLOR_RESET$ZSH_THEME_ACENOSTER_VI_MODE_PROMPT_SUFIX$COLOR_RESET"
411 | }
412 |
413 | timer_current_time() {
414 | zmodload zsh/datetime
415 | echo $EPOCHREALTIME
416 | }
417 |
418 | timer_format_duration() {
419 | local mins=$(printf '%.0f' $(($1 / 60)))
420 | local secs=$(printf "%.${TIMER_PRECISION:-3}f" $(($1 - 60 * mins)))
421 | local duration_str=$(echo "${mins}m ${secs}s")
422 | echo "${duration_str#0m }"
423 | }
424 |
425 | preexec () {
426 | TIMER_CMD_START_TIME=$(timer_current_time)
427 | }
428 |
429 | precmd () {
430 | LAST_EXIT_CODE=$?
431 | TIMER_CMD_END_TIME=$(timer_current_time)
432 | BACKGROUND_TASKS=$(jobs -l | wc -l)
433 | acenoster_update_icons
434 | acenoster_update_appearance
435 | [[ $ZSH_THEME_ACENOSTER_COMPACT -eq 0 ]] && print
436 | acenoster_pre_prompt
437 | unset TIMER_CMD_START_TIME
438 | }
439 |
440 | get_space () {
441 | local str=$(echo $1$2 | sed 's/\x1B[@A-Z\\\]^_]\|\x1B\[[0-9:;<=>?]*[-!"#$%&'"'"'()*+,.\/]*[][\\@A-Z^_`a-z{|}~]//g')
442 | local len=${#str}
443 | local spaces=$((COLUMNS-len))
444 | [[ spaces -le 0 ]] && return
445 | printf ' %.0s' {1..$spaces}
446 | }
447 |
448 | acenoster_pre_prompt () {
449 | left="$(print -P $PRE_LPROMPT)"
450 | right="$(print -P $PRE_RPROMPT)"
451 | local spaces=$(get_space $left $right)
452 | print -P "$left$spaces$right"
453 | }
454 |
455 | # Main prompt
456 | PRE_LPROMPT="╭─\$(acenoster_prompt_user)\$(acenoster_prompt_host)\$(acenoster_aws_prompt_info)\$(acenoster_prompt_dir)\$(acenoster_git_super_status)\$(acenoster_prompt_hg)\$(acenoster_virtualenv_prompt_info)"
457 | PRE_RPROMPT="\$(acenoster_prompt_battery)\$(acenoster_prompt_timer)\$(acenoster_emoji-clock)\$(acenoster_prompt_clock)\$(acenoster_prompt_calendar)"
458 | PROMPT="╰─\$(acenoster_prompt_back_task)\$(acenoster_prompt_exit_code)\$(acenoster_prompt_vi_mode)"
459 | RPROMPT=""
460 |
--------------------------------------------------------------------------------