aboutsummaryrefslogtreecommitdiff
path: root/internal/wizard.zsh
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2023-04-02 15:22:01 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2023-04-02 15:22:01 +0300
commitd031df752b6c5a8c7f4e2bb33b23af01a559ff2e (patch)
tree9ae88b857adb15b972dd14a22553a605dba75ff1 /internal/wizard.zsh
parent6314edf35c2529179449a12d24071803b1eaa029 (diff)
wizard: detect POWERLEVEL9K_MODE=nerdfont-v3
This is Step 2 of https://github.com/romkatv/powerlevel10k/issues/2217#issuecomment-1493271666.
Diffstat (limited to 'internal/wizard.zsh')
-rw-r--r--internal/wizard.zsh43
1 files changed, 27 insertions, 16 deletions
diff --git a/internal/wizard.zsh b/internal/wizard.zsh
index 66fe73db..f15dfb35 100644
--- a/internal/wizard.zsh
+++ b/internal/wizard.zsh
@@ -766,11 +766,12 @@ function ask_quotes() {
return 0
}
-function ask_debian() {
- add_widget 0 flowing -c %BDoes this look like a%b "%2FDebian logo%f" "%B(swirl/spiral)?%b"
- add_widget 0 flowing -c reference: "$(href https://debian.org/logos/openlogo-nd.svg)"
+function ask_arrow() {
+ [[ -n $2 ]] && add_widget 0 flowing -c "$2"
+ add_widget 0 flowing -c %BDoes this look like an%b "%2Fupwards arrow%f%B?%b"
+ add_widget 0 flowing -c reference: "$(href https://graphemica.com/%F0%9F%A0%89)"
add_widget 0 print -P ""
- add_widget 0 flowing -c -- "---> \uF306 <---"
+ add_widget 0 flowing -c -- "---> $1 <---"
add_widget 0 print -P ""
add_widget 3
add_widget 0 print -P "%B(y) Yes.%b"
@@ -783,8 +784,8 @@ function ask_debian() {
ask ynr
case $choice in
r) return 1;;
- y) cap_debian=1;;
- n) cap_debian=0;;
+ y) cap_arrow=1;;
+ n) cap_arrow=0;;
esac
return 0
}
@@ -910,7 +911,7 @@ function ask_charset() {
POWERLEVEL9K_ICON_PADDING=none
cap_diamond=0
cap_python=0
- cap_debian=0
+ cap_arrow=0
cap_lock=0
cap_quotes=0
;;
@@ -1721,9 +1722,14 @@ function generate_config() {
sub PYTHON_ICON "'🐍'"
fi
- if [[ $POWERLEVEL9K_MODE == nerdfont-complete ]]; then
- sub BATTERY_STAGES "'\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'"
- fi
+ case $POWERLEVEL9K_MODE in
+ nerdfont-complete)
+ sub BATTERY_STAGES "'\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'"
+ ;;
+ nerdfont-v3)
+ sub BATTERY_STAGES "'\UF008E\UF007A\UF007B\UF007C\UF007D\UF007E\UF007F\UF0080\UF0081\UF0082\UF0079'"
+ ;;
+ esac
if [[ $style == (classic|rainbow) ]]; then
if [[ $style == classic ]]; then
@@ -2047,7 +2053,7 @@ while true; do
local gap_char=' ' prompt_char='❯' down_triangle='\uE0BC' up_triangle='\uE0BA' slanted_bar='\u2571'
local left_subsep= right_subsep= left_tail= right_tail= left_head= right_head= time=
local -i num_lines=2 empty_line=0 color=2 left_frame=1 right_frame=1 transient_prompt=0
- local -i cap_diamond=0 cap_python=0 cap_debian=0 cap_lock=0 cap_quotes=0
+ local -i cap_diamond=0 cap_python=0 cap_arrow=0 cap_lock=0 cap_quotes=0
local -a extra_icons=('' '' '')
local -a frame_color=(244 242 240 238)
local -a color_name=(Lightest Light Dark Darkest)
@@ -2088,12 +2094,17 @@ while true; do
elif (( ! cap_diamond )); then
POWERLEVEL9K_MODE=awesome-fontconfig
else
- ask_debian || continue
- if (( cap_debian )); then
- POWERLEVEL9K_MODE=nerdfont-complete
+ ask_arrow '\UF0737' || continue
+ if (( cap_arrow )); then
+ POWERLEVEL9K_MODE=nerdfont-v3
else
- POWERLEVEL9K_MODE=awesome-fontconfig
- ask_python || continue
+ ask_arrow '\uFC35' "Let's try another one." || continue
+ if (( cap_arrow )); then
+ POWERLEVEL9K_MODE=nerdfont-complete
+ else
+ POWERLEVEL9K_MODE=awesome-fontconfig
+ ask_python || continue
+ fi
fi
fi
fi