summaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2023-06-11 10:07:41 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2023-06-11 10:07:41 +0300
commitcc4878aef2bdefbac98fa135fca6070d27e4f041 (patch)
tree8089d71645e2c526527547cda0ab2947d5732ac6 /internal/p10k.zsh
parentc775a3ffd5c68b3aebbe78a27711cb395782bd88 (diff)
fix chezmoi segment and rename it to chezmoi_shell (#2311)
- Link to the project's homepage rather than its source code. - Move `chezmoi_shell` next to all the other *shell indicator* segments. - Use a shade of blue that resembes the color on chezmoi.io. - Don't go beyond 8 colors in 8-color configs. - Remove the segment from the *pure* config. - Fix whitespace padding on `CHEZMOI_ICON`. - Use the appropriate icon with all fonts (the same as `HOME`). - Add missing `CHEZMOI_ICON` definitions for "powerline" and "ascii" font modes. - Remove the redundant literal "chezmoi" content from the segment. - Fix instant prompt so that the segment is shown only when `$CHEZMOI` is non-empty.
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh14
1 files changed, 6 insertions, 8 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index b41c6ebb..ca735e50 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4260,19 +4260,17 @@ instant_prompt_vi_mode() {
fi
}
-################################################################
-# Segment to display chezmoi information.
-# More information: https://www.chezmoi.io/
-prompt_chezmoi() {
- _p9k_prompt_segment "$0" "black" "white" 'CHEZMOI_ICON' 0 '' "chezmoi"
+# Chezmoi shell indicator: https://www.chezmoi.io/
+prompt_chezmoi_shell() {
+ _p9k_prompt_segment $0 blue $_p9k_color1 CHEZMOI_ICON 0 '' ''
}
-_p9k_prompt_chezmoi_init() {
+_p9k_prompt_chezmoi_shell_init() {
typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$CHEZMOI'
}
-function instant_prompt_chezmoi() {
- _p9k_prompt_segment prompt_chezmoi "black" "white" CHEZMOI_ICON 0 '' 'chezmoi'
+function instant_prompt_chezmoi_shell() {
+ _p9k_prompt_segment prompt_chezmoi_shell blue $_p9k_color1 CHEZMOI_ICON 1 '$CHEZMOI_ICON' ''
}
################################################################