mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-22 04:10:07 +00:00
wizard: detect POWERLEVEL9K_MODE=nerdfont-v3
This is Step 2 of https://github.com/romkatv/powerlevel10k/issues/2217#issuecomment-1493271666.
This commit is contained in:
parent
6314edf35c
commit
d031df752b
1 changed files with 27 additions and 16 deletions
|
@ -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
|
||||
case $POWERLEVEL9K_MODE in
|
||||
nerdfont-complete)
|
||||
sub BATTERY_STAGES "'\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'"
|
||||
fi
|
||||
;;
|
||||
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,8 +2094,12 @@ while true; do
|
|||
elif (( ! cap_diamond )); then
|
||||
POWERLEVEL9K_MODE=awesome-fontconfig
|
||||
else
|
||||
ask_debian || continue
|
||||
if (( cap_debian )); then
|
||||
ask_arrow '\UF0737' || continue
|
||||
if (( cap_arrow )); then
|
||||
POWERLEVEL9K_MODE=nerdfont-v3
|
||||
else
|
||||
ask_arrow '\uFC35' "Let's try another one." || continue
|
||||
if (( cap_arrow )); then
|
||||
POWERLEVEL9K_MODE=nerdfont-complete
|
||||
else
|
||||
POWERLEVEL9K_MODE=awesome-fontconfig
|
||||
|
@ -2097,6 +2107,7 @@ while true; do
|
|||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
POWERLEVEL9K_MODE=ascii
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue