batipanel 0.4.15 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/lib/shell-setup.sh +44 -17
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.4.
|
|
1
|
+
0.4.16
|
package/lib/shell-setup.sh
CHANGED
|
@@ -64,27 +64,40 @@ _generate_zsh_prompt() {
|
|
|
64
64
|
# batipanel zsh prompt (no Oh My Zsh needed)
|
|
65
65
|
# This file is sourced from .zshrc
|
|
66
66
|
|
|
67
|
-
# enable colors
|
|
68
67
|
autoload -U colors && colors
|
|
69
|
-
|
|
70
|
-
# enable git info
|
|
71
68
|
autoload -Uz vcs_info
|
|
69
|
+
setopt PROMPT_SUBST
|
|
70
|
+
|
|
71
|
+
# detect powerline font support
|
|
72
|
+
_bp_sep='▸'
|
|
73
|
+
_bp_git='⎇'
|
|
74
|
+
if [[ "$(uname -s)" == "Darwin" ]]; then
|
|
75
|
+
if ls ~/Library/Fonts/*owerline* &>/dev/null 2>&1 \
|
|
76
|
+
|| ls ~/Library/Fonts/*erd* &>/dev/null 2>&1 \
|
|
77
|
+
|| ls /Library/Fonts/*erd* &>/dev/null 2>&1; then
|
|
78
|
+
_bp_sep=$'\uE0B0'
|
|
79
|
+
_bp_git=$'\uE0A0'
|
|
80
|
+
fi
|
|
81
|
+
else
|
|
82
|
+
if fc-list 2>/dev/null | grep -qi "powerline\|nerd"; then
|
|
83
|
+
_bp_sep=$'\uE0B0'
|
|
84
|
+
_bp_git=$'\uE0A0'
|
|
85
|
+
fi
|
|
86
|
+
fi
|
|
87
|
+
|
|
72
88
|
precmd() { vcs_info }
|
|
73
|
-
zstyle ':vcs_info:git:*' formats
|
|
89
|
+
zstyle ':vcs_info:git:*' formats " %F{black}%K{green} ${_bp_git} %b %k%F{green}${_bp_sep}%f"
|
|
74
90
|
zstyle ':vcs_info:*' enable git
|
|
75
91
|
|
|
76
|
-
#
|
|
77
|
-
setopt PROMPT_SUBST
|
|
78
|
-
|
|
79
|
-
# dark terminal colors via OSC escape sequences (works immediately)
|
|
92
|
+
# dark terminal colors via OSC (works immediately, no Terminal.app config needed)
|
|
80
93
|
if [[ "$TERM" != "dumb" ]]; then
|
|
81
|
-
printf '\e]11;#1e1e2e\a' # background:
|
|
82
|
-
printf '\e]10;#cdd6f4\a' # foreground:
|
|
83
|
-
printf '\e]12;#f5e0dc\a' # cursor:
|
|
94
|
+
printf '\e]11;#1e1e2e\a' # background: catppuccin base
|
|
95
|
+
printf '\e]10;#cdd6f4\a' # foreground: catppuccin text
|
|
96
|
+
printf '\e]12;#f5e0dc\a' # cursor: catppuccin rosewater
|
|
84
97
|
fi
|
|
85
98
|
|
|
86
|
-
# prompt
|
|
87
|
-
PROMPT=
|
|
99
|
+
# prompt
|
|
100
|
+
PROMPT="%K{blue}%F{white} %n %f%k%F{blue}%K{240}${_bp_sep}%f%F{white} %~ %f%k%F{240}\${vcs_info_msg_0_:-%F{240}${_bp_sep}}%f "
|
|
88
101
|
RPROMPT='%(?..%F{red}✘ %?%f)'
|
|
89
102
|
ZSH_PROMPT_EOF
|
|
90
103
|
}
|
|
@@ -132,6 +145,20 @@ if [[ "$TERM" != "dumb" ]]; then
|
|
|
132
145
|
printf '\e]12;#f5e0dc\a'
|
|
133
146
|
fi
|
|
134
147
|
|
|
148
|
+
# detect powerline font
|
|
149
|
+
_bp_sep='▸'
|
|
150
|
+
_bp_git='⎇'
|
|
151
|
+
if [ "$(uname -s)" = "Darwin" ]; then
|
|
152
|
+
if ls ~/Library/Fonts/*owerline* &>/dev/null 2>&1 \
|
|
153
|
+
|| ls ~/Library/Fonts/*erd* &>/dev/null 2>&1; then
|
|
154
|
+
_bp_sep=$'\uE0B0'
|
|
155
|
+
_bp_git=$'\uE0A0'
|
|
156
|
+
fi
|
|
157
|
+
elif fc-list 2>/dev/null | grep -qi "powerline\|nerd"; then
|
|
158
|
+
_bp_sep=$'\uE0B0'
|
|
159
|
+
_bp_git=$'\uE0A0'
|
|
160
|
+
fi
|
|
161
|
+
|
|
135
162
|
__batipanel_prompt() {
|
|
136
163
|
local exit_code=$?
|
|
137
164
|
local bg_user="\[\e[44m\]"
|
|
@@ -147,18 +174,18 @@ __batipanel_prompt() {
|
|
|
147
174
|
local t_git="\[\e[32m\]"
|
|
148
175
|
local ps=""
|
|
149
176
|
if [ "$exit_code" -ne 0 ]; then
|
|
150
|
-
ps+="\[\e[41m\]\[\e[97m\] ✘ ${exit_code} \[\e[31;48;5;240m\]
|
|
177
|
+
ps+="\[\e[41m\]\[\e[97m\] ✘ ${exit_code} \[\e[31;48;5;240m\]${_bp_sep}"
|
|
151
178
|
fi
|
|
152
|
-
ps+="${bg_user}${fg_user} \\u ${t_user}
|
|
179
|
+
ps+="${bg_user}${fg_user} \\u ${t_user}${_bp_sep}"
|
|
153
180
|
ps+="${bg_dir}${fg_dir} \\w "
|
|
154
181
|
local git_branch=""
|
|
155
182
|
if command -v git &>/dev/null; then
|
|
156
183
|
git_branch="$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)"
|
|
157
184
|
fi
|
|
158
185
|
if [ -n "$git_branch" ]; then
|
|
159
|
-
ps+="${t_dir}
|
|
186
|
+
ps+="${t_dir}${_bp_sep}${bg_git}${fg_git} ${_bp_git} ${git_branch} ${reset}${t_git}${_bp_sep}${reset} "
|
|
160
187
|
else
|
|
161
|
-
ps+="${reset}${t_end}
|
|
188
|
+
ps+="${reset}${t_end}${_bp_sep}${reset} "
|
|
162
189
|
fi
|
|
163
190
|
PS1="$ps"
|
|
164
191
|
}
|
package/package.json
CHANGED