|
|
@ -14,11 +14,22 @@ if (( OPTIND <= ARGC )); then
|
|
|
|
return 1
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (( $+terminfo[smcup] && $+terminfo[rmcup] )) && echoti smcup 2>/dev/null; then
|
|
|
|
|
|
|
|
function restore_screen() {
|
|
|
|
|
|
|
|
echoti rmcup 2>/dev/null
|
|
|
|
|
|
|
|
function restore_screen() {}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
function restore_screen() {}
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
local -i in_z4h_wizard=0
|
|
|
|
local -i in_z4h_wizard=0
|
|
|
|
[[ $force == 0 && $+functions[z4h] == 1 && -n $Z4H && -e $Z4H/welcome ]] && in_z4h_wizard=1
|
|
|
|
[[ $force == 0 && $+functions[z4h] == 1 && -n $Z4H && -e $Z4H/welcome ]] && in_z4h_wizard=1
|
|
|
|
|
|
|
|
|
|
|
|
local -i success=0
|
|
|
|
local -i success=0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ # always
|
|
|
|
|
|
|
|
|
|
|
|
local -ri force
|
|
|
|
local -ri force
|
|
|
|
|
|
|
|
|
|
|
|
local -r font_base_url='https://github.com/romkatv/powerlevel10k-media/raw/master'
|
|
|
|
local -r font_base_url='https://github.com/romkatv/powerlevel10k-media/raw/master'
|
|
|
@ -222,12 +233,7 @@ function hide_cursor() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function show_cursor() {
|
|
|
|
function show_cursor() {
|
|
|
|
local cnorm=${terminfo[cnorm]-}
|
|
|
|
echoti cnorm 2>/dev/null
|
|
|
|
if [[ $cnorm == *$'\e[?25h'(|'\e'*) ]]; then
|
|
|
|
|
|
|
|
print -n '\e[?25h'
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
print -n $cnorm
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function consume_input() {
|
|
|
|
function consume_input() {
|
|
|
@ -744,7 +750,7 @@ function ask_python() {
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function ask_quotes() {
|
|
|
|
function ask_arrow() {
|
|
|
|
add_widget 0 flowing -c %BDoes this look like%b "%2F><%f" %Bbut taller and "fatter?%b"
|
|
|
|
add_widget 0 flowing -c %BDoes this look like%b "%2F><%f" %Bbut taller and "fatter?%b"
|
|
|
|
add_widget 0 print -P ""
|
|
|
|
add_widget 0 print -P ""
|
|
|
|
add_widget 0 flowing -c -- "---> \u276F\u276E <---"
|
|
|
|
add_widget 0 flowing -c -- "---> \u276F\u276E <---"
|
|
|
@ -760,23 +766,17 @@ function ask_quotes() {
|
|
|
|
ask ynr
|
|
|
|
ask ynr
|
|
|
|
case $choice in
|
|
|
|
case $choice in
|
|
|
|
r) return 1;;
|
|
|
|
r) return 1;;
|
|
|
|
y) cap_quotes=1;;
|
|
|
|
y) cap_arrow=1;;
|
|
|
|
n) cap_quotes=0;;
|
|
|
|
n) cap_arrow=0;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function ask_arrow() {
|
|
|
|
function ask_debian() {
|
|
|
|
# This condition holds as long as zsh is compiled with unicode 9 support.
|
|
|
|
add_widget 0 flowing -c %BDoes this look like a%b "%2FDebian logo%f" "%B(swirl/spiral)?%b"
|
|
|
|
if (( ${(m)#${(g::)1}} != 1 )); then
|
|
|
|
add_widget 0 flowing -c reference: "$(href https://debian.org/logos/openlogo-nd.svg)"
|
|
|
|
cap_arrow=0
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
[[ -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 print -P ""
|
|
|
|
add_widget 0 flowing -c -- "---> $1 <---"
|
|
|
|
add_widget 0 flowing -c -- "---> \uF306 <---"
|
|
|
|
add_widget 0 print -P ""
|
|
|
|
add_widget 0 print -P ""
|
|
|
|
add_widget 3
|
|
|
|
add_widget 3
|
|
|
|
add_widget 0 print -P "%B(y) Yes.%b"
|
|
|
|
add_widget 0 print -P "%B(y) Yes.%b"
|
|
|
@ -789,41 +789,8 @@ function ask_arrow() {
|
|
|
|
ask ynr
|
|
|
|
ask ynr
|
|
|
|
case $choice in
|
|
|
|
case $choice in
|
|
|
|
r) return 1;;
|
|
|
|
r) return 1;;
|
|
|
|
y) cap_arrow=1;;
|
|
|
|
y) cap_debian=1;;
|
|
|
|
n) cap_arrow=0;;
|
|
|
|
n) cap_debian=0;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function print_indented() {
|
|
|
|
|
|
|
|
local -i max_width=$1
|
|
|
|
|
|
|
|
local text=$2
|
|
|
|
|
|
|
|
local -i indent='(wizard_columns - max_width) / 2'
|
|
|
|
|
|
|
|
print -P "${(l:$indent:: :)}$text"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ask_width() {
|
|
|
|
|
|
|
|
add_widget 0 flowing -c %BWhat digit is the%b "%2Fdownwards arrow%f" %Bpointing "at?%b"
|
|
|
|
|
|
|
|
add_widget 0 print -P ""
|
|
|
|
|
|
|
|
add_widget 0 print_indented 11 '%3F\UF0734%f %3F\UF0734%f %3F\UF0734%f %2F\UF072E%f'
|
|
|
|
|
|
|
|
add_widget 0 print_indented 11 ' 111222'
|
|
|
|
|
|
|
|
add_widget 0 print -P ""
|
|
|
|
|
|
|
|
add_widget 3
|
|
|
|
|
|
|
|
add_widget 0 print -P "%B(1) It is pointing at '1'.%b"
|
|
|
|
|
|
|
|
add_widget 0 print -P ""
|
|
|
|
|
|
|
|
add_widget 1
|
|
|
|
|
|
|
|
add_widget 0 print -P "%B(2) It is pointing at '2'.%b"
|
|
|
|
|
|
|
|
add_widget 0 print -P ""
|
|
|
|
|
|
|
|
add_widget 1
|
|
|
|
|
|
|
|
add_widget 0 print -P "%B(3) Something else.%b"
|
|
|
|
|
|
|
|
add_widget 0 print -P ""
|
|
|
|
|
|
|
|
add_widget 2
|
|
|
|
|
|
|
|
add_widget 0 print -P "(r) Restart from the beginning."
|
|
|
|
|
|
|
|
ask 123r
|
|
|
|
|
|
|
|
case $choice in
|
|
|
|
|
|
|
|
r) return 1;;
|
|
|
|
|
|
|
|
1) cap_arrow=1;;
|
|
|
|
|
|
|
|
2|3) cap_arrow=0;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -949,9 +916,9 @@ function ask_charset() {
|
|
|
|
POWERLEVEL9K_ICON_PADDING=none
|
|
|
|
POWERLEVEL9K_ICON_PADDING=none
|
|
|
|
cap_diamond=0
|
|
|
|
cap_diamond=0
|
|
|
|
cap_python=0
|
|
|
|
cap_python=0
|
|
|
|
cap_arrow=0
|
|
|
|
cap_debian=0
|
|
|
|
cap_lock=0
|
|
|
|
cap_lock=0
|
|
|
|
cap_quotes=0
|
|
|
|
cap_arrow=0
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
@ -1027,15 +994,6 @@ function ask_color() {
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function print_frame_marker() {
|
|
|
|
|
|
|
|
local label="(1) $color_name[1]."
|
|
|
|
|
|
|
|
local -i n='wizard_columns - 7'
|
|
|
|
|
|
|
|
local -i m=$((n - $#label))
|
|
|
|
|
|
|
|
print -P "${(l:$n:: :)}frame"
|
|
|
|
|
|
|
|
print -P "%B$label%b${(l:$m:: :)} |"
|
|
|
|
|
|
|
|
print -P "${(l:$n:: :)} v"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ask_ornaments_color() {
|
|
|
|
function ask_ornaments_color() {
|
|
|
|
[[ $style != (rainbow|lean*) || $num_lines == 1 ]] && return
|
|
|
|
[[ $style != (rainbow|lean*) || $num_lines == 1 ]] && return
|
|
|
|
[[ $gap_char == ' ' && $left_frame == 0 && $right_frame == 0 ]] && return
|
|
|
|
[[ $gap_char == ' ' && $left_frame == 0 && $right_frame == 0 ]] && return
|
|
|
@ -1043,17 +1001,10 @@ function ask_ornaments_color() {
|
|
|
|
[[ $gap_char != ' ' ]] && ornaments+=Connection
|
|
|
|
[[ $gap_char != ' ' ]] && ornaments+=Connection
|
|
|
|
(( left_frame || right_frame )) && ornaments+=Frame
|
|
|
|
(( left_frame || right_frame )) && ornaments+=Frame
|
|
|
|
add_widget 0 flowing -c "%B${(j: & :)ornaments} Color%b"
|
|
|
|
add_widget 0 flowing -c "%B${(j: & :)ornaments} Color%b"
|
|
|
|
if (( left_frame || right_frame )); then
|
|
|
|
add_widget 0 print
|
|
|
|
add_widget 0 print_frame_marker
|
|
|
|
add_widget 1
|
|
|
|
add_widget 3 print -P "%B(1) $color_name[1].%b"
|
|
|
|
add_widget 0 print -P "%B(1) $color_name[1].%b"
|
|
|
|
add_prompt_n color=1
|
|
|
|
add_prompt color=1
|
|
|
|
add_widget 0 print
|
|
|
|
|
|
|
|
add_widget 2
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
add_widget 1
|
|
|
|
|
|
|
|
add_widget 0 print -P "%B(1) $color_name[1].%b"
|
|
|
|
|
|
|
|
add_prompt color=1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
add_widget 0 print -P "%B(2) $color_name[2].%b"
|
|
|
|
add_widget 0 print -P "%B(2) $color_name[2].%b"
|
|
|
|
add_prompt color=2
|
|
|
|
add_prompt color=2
|
|
|
|
add_widget 0 print -P "%B(3) $color_name[3].%b"
|
|
|
|
add_widget 0 print -P "%B(3) $color_name[3].%b"
|
|
|
@ -1075,19 +1026,19 @@ function ask_time() {
|
|
|
|
add_widget 0 flowing -c "%BShow current time?%b"
|
|
|
|
add_widget 0 flowing -c "%BShow current time?%b"
|
|
|
|
add_widget 0 print
|
|
|
|
add_widget 0 print
|
|
|
|
add_widget 1
|
|
|
|
add_widget 1
|
|
|
|
add_widget 0 print -P "%B(n) No.%b"
|
|
|
|
add_widget 0 print -P "%B(1) No.%b"
|
|
|
|
add_prompt time=
|
|
|
|
add_prompt time=
|
|
|
|
add_widget 0 print -P "%B(1) 12-hour format.%b"
|
|
|
|
|
|
|
|
add_prompt time=$time_12h
|
|
|
|
|
|
|
|
add_widget 0 print -P "%B(2) 24-hour format.%b"
|
|
|
|
add_widget 0 print -P "%B(2) 24-hour format.%b"
|
|
|
|
add_prompt time=$time_24h
|
|
|
|
add_prompt time=$time_24h
|
|
|
|
|
|
|
|
add_widget 0 print -P "%B(3) 12-hour format.%b"
|
|
|
|
|
|
|
|
add_prompt time=$time_12h
|
|
|
|
add_widget 0 print -P "(r) Restart from the beginning."
|
|
|
|
add_widget 0 print -P "(r) Restart from the beginning."
|
|
|
|
ask n12r
|
|
|
|
ask 123r
|
|
|
|
case $choice in
|
|
|
|
case $choice in
|
|
|
|
r) return 1;;
|
|
|
|
r) return 1;;
|
|
|
|
n) time=;;
|
|
|
|
1) time=;;
|
|
|
|
1) time=$time_12h; options+='12h time';;
|
|
|
|
|
|
|
|
2) time=$time_24h; options+='24h time';;
|
|
|
|
2) time=$time_24h; options+='24h time';;
|
|
|
|
|
|
|
|
3) time=$time_12h; options+='12h time';;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1126,26 +1077,18 @@ function os_icon_name() {
|
|
|
|
if [[ -r /etc/os-release ]]; then
|
|
|
|
if [[ -r /etc/os-release ]]; then
|
|
|
|
local lines=(${(f)"$(</etc/os-release)"})
|
|
|
|
local lines=(${(f)"$(</etc/os-release)"})
|
|
|
|
lines=(${(@M)lines:#ID=*})
|
|
|
|
lines=(${(@M)lines:#ID=*})
|
|
|
|
(( $#lines == 1 )) && os_release_id=${(Q)${lines[1]#ID=}}
|
|
|
|
(( $#lines == 1 )) && os_release_id=${lines[1]#ID=}
|
|
|
|
elif [[ -e /etc/artix-release ]]; then
|
|
|
|
elif [[ -e /etc/artix-release ]]; then
|
|
|
|
os_release_id=artix
|
|
|
|
os_release_id=artix
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
case $os_release_id in
|
|
|
|
case $os_release_id in
|
|
|
|
*arch*) echo LINUX_ARCH_ICON;;
|
|
|
|
*arch*) echo LINUX_ARCH_ICON;;
|
|
|
|
*raspbian*) echo LINUX_RASPBIAN_ICON;;
|
|
|
|
*debian*) echo LINUX_DEBIAN_ICON;;
|
|
|
|
*debian*)
|
|
|
|
|
|
|
|
if [[ -f /etc/apt/sources.list.d/raspi.list ]]; then
|
|
|
|
|
|
|
|
echo LINUX_RASPBIAN_ICON
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
echo LINUX_DEBIAN_ICON
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
*raspbian*) echo LINUX_RASPBIAN_ICON;;
|
|
|
|
*raspbian*) echo LINUX_RASPBIAN_ICON;;
|
|
|
|
*ubuntu*) echo LINUX_UBUNTU_ICON;;
|
|
|
|
*ubuntu*) echo LINUX_UBUNTU_ICON;;
|
|
|
|
*elementary*) echo LINUX_ELEMENTARY_ICON;;
|
|
|
|
*elementary*) echo LINUX_ELEMENTARY_ICON;;
|
|
|
|
*fedora*) echo LINUX_FEDORA_ICON;;
|
|
|
|
*fedora*) echo LINUX_FEDORA_ICON;;
|
|
|
|
*coreos*) echo LINUX_COREOS_ICON;;
|
|
|
|
*coreos*) echo LINUX_COREOS_ICON;;
|
|
|
|
*kali*) echo LINUX_KALI_ICON;;
|
|
|
|
|
|
|
|
*gentoo*) echo LINUX_GENTOO_ICON;;
|
|
|
|
*gentoo*) echo LINUX_GENTOO_ICON;;
|
|
|
|
*mageia*) echo LINUX_MAGEIA_ICON;;
|
|
|
|
*mageia*) echo LINUX_MAGEIA_ICON;;
|
|
|
|
*centos*) echo LINUX_CENTOS_ICON;;
|
|
|
|
*centos*) echo LINUX_CENTOS_ICON;;
|
|
|
@ -1161,11 +1104,6 @@ function os_icon_name() {
|
|
|
|
*void*) echo LINUX_VOID_ICON;;
|
|
|
|
*void*) echo LINUX_VOID_ICON;;
|
|
|
|
*artix*) echo LINUX_ARTIX_ICON;;
|
|
|
|
*artix*) echo LINUX_ARTIX_ICON;;
|
|
|
|
*rhel*) echo LINUX_RHEL_ICON;;
|
|
|
|
*rhel*) echo LINUX_RHEL_ICON;;
|
|
|
|
amzn) echo LINUX_AMZN_ICON;;
|
|
|
|
|
|
|
|
endeavouros) echo LINUX_ENDEAVOUROS_ICON;;
|
|
|
|
|
|
|
|
rocky) echo LINUX_ROCKY_ICON;;
|
|
|
|
|
|
|
|
guix) echo LINUX_GUIX_ICON;;
|
|
|
|
|
|
|
|
neon) echo LINUX_NEON_ICON;;
|
|
|
|
|
|
|
|
*) echo LINUX_ICON;;
|
|
|
|
*) echo LINUX_ICON;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
;;
|
|
|
@ -1239,7 +1177,7 @@ function ask_separators() {
|
|
|
|
add_widget 2
|
|
|
|
add_widget 2
|
|
|
|
add_widget 0 print -P "%B(2) Vertical.%b"
|
|
|
|
add_widget 0 print -P "%B(2) Vertical.%b"
|
|
|
|
add_prompt left_sep='' right_sep='' left_subsep=$vertical_bar right_subsep=$vertical_bar
|
|
|
|
add_prompt left_sep='' right_sep='' left_subsep=$vertical_bar right_subsep=$vertical_bar
|
|
|
|
if [[ $POWERLEVEL9K_MODE == nerdfont-* ]]; then
|
|
|
|
if [[ $POWERLEVEL9K_MODE == nerdfont-complete ]]; then
|
|
|
|
extra+=3
|
|
|
|
extra+=3
|
|
|
|
add_widget 0 print -P "%B(3) Slanted.%b"
|
|
|
|
add_widget 0 print -P "%B(3) Slanted.%b"
|
|
|
|
add_prompt left_sep=$down_triangle right_sep=$up_triangle left_subsep=$slanted_bar right_subsep=$slanted_bar
|
|
|
|
add_prompt left_sep=$down_triangle right_sep=$up_triangle left_subsep=$slanted_bar right_subsep=$slanted_bar
|
|
|
@ -1289,34 +1227,42 @@ function ask_heads() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
local extra
|
|
|
|
local extra
|
|
|
|
add_widget 0 flowing -c "%BPrompt Heads%b"
|
|
|
|
add_widget 0 flowing -c "%BPrompt Heads%b"
|
|
|
|
add_widget 0 print -Pl " head" "%B(1) Flat.%b |" " v"
|
|
|
|
if (( cap_diamond )); then
|
|
|
|
add_widget 3 print -P "%B(1) Flat.%b"
|
|
|
|
add_widget 0 print -Pl " head" "%B(1) Sharp.%b |" " v"
|
|
|
|
add_prompt_n left_head= right_head=
|
|
|
|
add_widget 3 print -P "%B(1) Sharp.%b"
|
|
|
|
add_widget 0 print
|
|
|
|
add_prompt_n left_head=$right_triangle right_head=$left_triangle
|
|
|
|
add_widget 2
|
|
|
|
add_widget 0 print
|
|
|
|
|
|
|
|
add_widget 2
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
add_widget 0 print
|
|
|
|
|
|
|
|
add_widget 1
|
|
|
|
|
|
|
|
add_widget 0 print -P "%B(1) Flat.%b"
|
|
|
|
|
|
|
|
add_prompt left_head= right_head=
|
|
|
|
|
|
|
|
fi
|
|
|
|
add_widget 0 print -P "%B(2) Blurred.%b"
|
|
|
|
add_widget 0 print -P "%B(2) Blurred.%b"
|
|
|
|
add_prompt left_head=$fade_out right_head=$fade_in
|
|
|
|
add_prompt left_head=$fade_out right_head=$fade_in
|
|
|
|
if (( cap_diamond )); then
|
|
|
|
if [[ $POWERLEVEL9K_MODE == nerdfont-complete ]]; then
|
|
|
|
extra+=3
|
|
|
|
extra+=3
|
|
|
|
add_widget 0 print -P "%B(3) Sharp.%b"
|
|
|
|
add_widget 0 print -P "%B(3) Slanted.%b"
|
|
|
|
add_prompt left_head=$right_triangle right_head=$left_triangle
|
|
|
|
add_prompt left_head=$down_triangle right_head=$up_triangle
|
|
|
|
if [[ $POWERLEVEL9K_MODE == nerdfont-* ]]; then
|
|
|
|
extra+=4
|
|
|
|
extra+=4
|
|
|
|
add_widget 0 print -P "%B(4) Round.%b"
|
|
|
|
add_widget 0 print -P "%B(4) Slanted.%b"
|
|
|
|
add_prompt left_head=$right_circle right_head=$left_circle
|
|
|
|
add_prompt left_head=$down_triangle right_head=$up_triangle
|
|
|
|
|
|
|
|
extra+=5
|
|
|
|
|
|
|
|
add_widget 0 print -P "%B(5) Round.%b"
|
|
|
|
|
|
|
|
add_prompt left_head=$right_circle right_head=$left_circle
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
add_widget 0 print -P "(r) Restart from the beginning."
|
|
|
|
add_widget 0 print -P "(r) Restart from the beginning."
|
|
|
|
ask 12${extra}r
|
|
|
|
ask 12${extra}r
|
|
|
|
case $choice in
|
|
|
|
case $choice in
|
|
|
|
r) return 1;;
|
|
|
|
r) return 1;;
|
|
|
|
1)
|
|
|
|
1)
|
|
|
|
left_head=
|
|
|
|
if (( cap_diamond )); then
|
|
|
|
right_head=
|
|
|
|
left_head=$right_triangle
|
|
|
|
options+='flat heads'
|
|
|
|
right_head=$left_triangle
|
|
|
|
|
|
|
|
options+='sharp heads'
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
left_head=
|
|
|
|
|
|
|
|
right_head=
|
|
|
|
|
|
|
|
options+='flat heads'
|
|
|
|
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
2)
|
|
|
|
2)
|
|
|
|
left_head=$fade_out
|
|
|
|
left_head=$fade_out
|
|
|
@ -1324,16 +1270,11 @@ function ask_heads() {
|
|
|
|
options+='blurred heads'
|
|
|
|
options+='blurred heads'
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
3)
|
|
|
|
3)
|
|
|
|
left_head=$right_triangle
|
|
|
|
|
|
|
|
right_head=$left_triangle
|
|
|
|
|
|
|
|
options+='sharp heads'
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
4)
|
|
|
|
|
|
|
|
left_head=$down_triangle
|
|
|
|
left_head=$down_triangle
|
|
|
|
right_head=$up_triangle
|
|
|
|
right_head=$up_triangle
|
|
|
|
options+='slanted heads'
|
|
|
|
options+='slanted heads'
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
5)
|
|
|
|
4)
|
|
|
|
left_head=$right_circle
|
|
|
|
left_head=$right_circle
|
|
|
|
right_head=$left_circle
|
|
|
|
right_head=$left_circle
|
|
|
|
options+='round heads'
|
|
|
|
options+='round heads'
|
|
|
@ -1368,7 +1309,7 @@ function ask_tails() {
|
|
|
|
extra+=3
|
|
|
|
extra+=3
|
|
|
|
add_widget 0 print -P "%B(3) Sharp.%b"
|
|
|
|
add_widget 0 print -P "%B(3) Sharp.%b"
|
|
|
|
add_prompt left_tail=$left_triangle right_tail=$right_triangle
|
|
|
|
add_prompt left_tail=$left_triangle right_tail=$right_triangle
|
|
|
|
if [[ $POWERLEVEL9K_MODE == nerdfont-* ]]; then
|
|
|
|
if [[ $POWERLEVEL9K_MODE == nerdfont-complete ]]; then
|
|
|
|
extra+=4
|
|
|
|
extra+=4
|
|
|
|
add_widget 0 print -P "%B(4) Slanted.%b"
|
|
|
|
add_widget 0 print -P "%B(4) Slanted.%b"
|
|
|
|
add_prompt left_tail=$up_triangle right_tail=$down_triangle
|
|
|
|
add_prompt left_tail=$up_triangle right_tail=$down_triangle
|
|
|
@ -1506,14 +1447,14 @@ function ask_empty_line() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function print_instant_prompt_link() {
|
|
|
|
function print_instant_prompt_link() {
|
|
|
|
local link='https://github.com/romkatv/powerlevel10k#instant-prompt'
|
|
|
|
local link='https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt'
|
|
|
|
(( wizard_columns < $#link )) && return
|
|
|
|
(( wizard_columns < $#link )) && return
|
|
|
|
print
|
|
|
|
print
|
|
|
|
flowing -c "$(href $link)"
|
|
|
|
flowing -c "$(href $link)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function ask_instant_prompt() {
|
|
|
|
function ask_instant_prompt() {
|
|
|
|
if [[ $ZSH_VERSION != (5.<4->*|<6->.*) ]]; then
|
|
|
|
if ! is-at-least 5.4; then
|
|
|
|
instant_prompt=off
|
|
|
|
instant_prompt=off
|
|
|
|
options+=instant_prompt=auto-off
|
|
|
|
options+=instant_prompt=auto-off
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
@ -1606,19 +1547,9 @@ function ask_config_overwrite() {
|
|
|
|
case $choice in
|
|
|
|
case $choice in
|
|
|
|
r) return 1;;
|
|
|
|
r) return 1;;
|
|
|
|
y)
|
|
|
|
y)
|
|
|
|
if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then
|
|
|
|
config_backup="$(mktemp ${TMPDIR:-/tmp}/$__p9k_cfg_basename.XXXXXXXXXX)" || quit -c
|
|
|
|
local tmpdir=$TMPDIR
|
|
|
|
cp $__p9k_cfg_path $config_backup || quit -c
|
|
|
|
local tmpdir_u='$TMPDIR'
|
|
|
|
config_backup_u=${${TMPDIR:+\$TMPDIR}:-/tmp}/${(q-)config_backup:t}
|
|
|
|
else
|
|
|
|
|
|
|
|
local tmpdir=/tmp
|
|
|
|
|
|
|
|
local tmpdir_u=/tmp
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if (( ! $+commands[mktemp] )) ||
|
|
|
|
|
|
|
|
! config_backup=$(mktemp $tmpdir/$__p9k_cfg_basename.XXXXXXXXXX 2>/dev/null); then
|
|
|
|
|
|
|
|
config_backup=$tmpdir/$__p9k_cfg_basename.$EPOCHREALTIME
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
cp $__p9k_cfg_path $config_backup || quit -c
|
|
|
|
|
|
|
|
config_backup_u=$tmpdir_u/${(q-)config_backup:t}
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
@ -1635,12 +1566,40 @@ function ask_zshrc_edit() {
|
|
|
|
if (( $+functions[z4h] )); then
|
|
|
|
if (( $+functions[z4h] )); then
|
|
|
|
zshrc_has_cfg=1
|
|
|
|
zshrc_has_cfg=1
|
|
|
|
zshrc_has_instant_prompt=1
|
|
|
|
zshrc_has_instant_prompt=1
|
|
|
|
return
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
check_zshrc_integration || quit -c
|
|
|
|
|
|
|
|
[[ $instant_prompt == off ]] && zshrc_has_instant_prompt=1
|
|
|
|
[[ $instant_prompt == off ]] && zshrc_has_instant_prompt=1
|
|
|
|
(( zshrc_has_cfg && zshrc_has_instant_prompt )) && return
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -e $__p9k_zshrc ]]; then
|
|
|
|
|
|
|
|
zshrc_content="$(<$__p9k_zshrc)" || quit -c
|
|
|
|
|
|
|
|
local lines=(${(f)zshrc_content})
|
|
|
|
|
|
|
|
local f0=$__p9k_cfg_path_o
|
|
|
|
|
|
|
|
local f1=${(q)f0}
|
|
|
|
|
|
|
|
local f2=${(q-)f0}
|
|
|
|
|
|
|
|
local f3=${(qq)f0}
|
|
|
|
|
|
|
|
local f4=${(qqq)f0}
|
|
|
|
|
|
|
|
local g1=${${(q)__p9k_cfg_path_o}/#(#b)${(q)HOME}\//'~/'}
|
|
|
|
|
|
|
|
local h0='${ZDOTDIR:-~}/.p10k.zsh'
|
|
|
|
|
|
|
|
local h1='${ZDOTDIR:-$HOME}/.p10k.zsh'
|
|
|
|
|
|
|
|
local h2='"${ZDOTDIR:-$HOME}/.p10k.zsh"'
|
|
|
|
|
|
|
|
local h3='"${ZDOTDIR:-$HOME}"/.p10k.zsh'
|
|
|
|
|
|
|
|
local h4='${ZDOTDIR}/.p10k.zsh'
|
|
|
|
|
|
|
|
local h5='"${ZDOTDIR}/.p10k.zsh"'
|
|
|
|
|
|
|
|
local h6='"${ZDOTDIR}"/.p10k.zsh'
|
|
|
|
|
|
|
|
local h7='$ZDOTDIR/.p10k.zsh'
|
|
|
|
|
|
|
|
local h8='"$ZDOTDIR/.p10k.zsh"'
|
|
|
|
|
|
|
|
local h9='"$ZDOTDIR"/.p10k.zsh'
|
|
|
|
|
|
|
|
local h10='$POWERLEVEL9K_CONFIG_FILE'
|
|
|
|
|
|
|
|
local h11='"$POWERLEVEL9K_CONFIG_FILE"'
|
|
|
|
|
|
|
|
if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($f1|$f2|$f3|$f4|$g1|$h0|$h1|$h2|$h3|$h4|$h5|$h6|$h7|$h8|$h9|$h10|$h11)(|[[:space:]]*|'#'*)} ]]; then
|
|
|
|
|
|
|
|
zshrc_has_cfg=1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
local pre='${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh'
|
|
|
|
|
|
|
|
if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($pre|\"$pre\")(|[[:space:]]*|'#'*)} ]]; then
|
|
|
|
|
|
|
|
zshrc_has_instant_prompt=1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
(( zshrc_has_cfg && zshrc_has_instant_prompt )) && return
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
add_widget 0 flowing -c %BApply changes to "%b%2F${__p9k_zshrc_u//\\/\\\\}%f%B?%b"
|
|
|
|
add_widget 0 flowing -c %BApply changes to "%b%2F${__p9k_zshrc_u//\\/\\\\}%f%B?%b"
|
|
|
|
add_widget 0 print -P ""
|
|
|
|
add_widget 0 print -P ""
|
|
|
@ -1679,26 +1638,16 @@ function ask_zshrc_edit() {
|
|
|
|
y)
|
|
|
|
y)
|
|
|
|
write_zshrc=1
|
|
|
|
write_zshrc=1
|
|
|
|
if [[ -n $zshrc_content ]]; then
|
|
|
|
if [[ -n $zshrc_content ]]; then
|
|
|
|
if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then
|
|
|
|
zshrc_backup="$(mktemp ${TMPDIR:-/tmp}/.zshrc.XXXXXXXXXX)" || quit -c
|
|
|
|
local tmpdir=$TMPDIR
|
|
|
|
cp -p $__p9k_zshrc $zshrc_backup || quit -c
|
|
|
|
local tmpdir_u='$TMPDIR'
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
local tmpdir=/tmp
|
|
|
|
|
|
|
|
local tmpdir_u=/tmp
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
if (( ! $+commands[mktemp] )) ||
|
|
|
|
|
|
|
|
! zshrc_backup="$(mktemp $tmpdir/.zshrc.XXXXXXXXXX 2>/dev/null)"; then
|
|
|
|
|
|
|
|
zshrc_backup=$tmpdir/.zshrc.$EPOCHREALTIME
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
cp -p $__p9k_zshrc $zshrc_backup || quit -c
|
|
|
|
|
|
|
|
local -i writable=1
|
|
|
|
local -i writable=1
|
|
|
|
if [[ ! -w $zshrc_backup ]]; then
|
|
|
|
if [[ ! -w $zshrc_backup ]]; then
|
|
|
|
chmod u+w -- $zshrc_backup || quit -c
|
|
|
|
chmod u+w -- $zshrc_backup || quit -c
|
|
|
|
writable=0
|
|
|
|
writable=0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
print -r -- $zshrc_content >$zshrc_backup || quit -c
|
|
|
|
print -r -- $zshrc_content >$zshrc_backup || quit -c
|
|
|
|
(( writable )) || chmod u-w -- $zshrc_backup || quit -c
|
|
|
|
(( writable )) || chmod u-w -- $zshrc_backup || quit -c
|
|
|
|
zshrc_backup_u=$tmpdir_u/${(q-)zshrc_backup:t}
|
|
|
|
zshrc_backup_u=${${TMPDIR:+\$TMPDIR}:-/tmp}/${(q-)zshrc_backup:t}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
@ -1747,8 +1696,6 @@ function generate_config() {
|
|
|
|
sub NORDVPN_VISUAL_IDENTIFIER_EXPANSION "'nord'"
|
|
|
|
sub NORDVPN_VISUAL_IDENTIFIER_EXPANSION "'nord'"
|
|
|
|
uncomment 'typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION'
|
|
|
|
uncomment 'typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION'
|
|
|
|
sub RANGER_VISUAL_IDENTIFIER_EXPANSION "'▲'"
|
|
|
|
sub RANGER_VISUAL_IDENTIFIER_EXPANSION "'▲'"
|
|
|
|
uncomment 'typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION'
|
|
|
|
|
|
|
|
sub YAZI_VISUAL_IDENTIFIER_EXPANSION "'▲'"
|
|
|
|
|
|
|
|
uncomment 'typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION'
|
|
|
|
uncomment 'typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION'
|
|
|
|
sub KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION "'○'"
|
|
|
|
sub KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION "'○'"
|
|
|
|
uncomment 'typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION'
|
|
|
|
uncomment 'typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION'
|
|
|
@ -1770,14 +1717,9 @@ function generate_config() {
|
|
|
|
sub PYTHON_ICON "'🐍'"
|
|
|
|
sub PYTHON_ICON "'🐍'"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
case $POWERLEVEL9K_MODE in
|
|
|
|
if [[ $POWERLEVEL9K_MODE == nerdfont-complete ]]; then
|
|
|
|
nerdfont-complete)
|
|
|
|
sub BATTERY_STAGES "'\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'"
|
|
|
|
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|rainbow) ]]; then
|
|
|
|
if [[ $style == classic ]]; then
|
|
|
|
if [[ $style == classic ]]; then
|
|
|
@ -1957,7 +1899,7 @@ function generate_config() {
|
|
|
|
command mkdir -p -- ${__p9k_cfg_path:h} || return
|
|
|
|
command mkdir -p -- ${__p9k_cfg_path:h} || return
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -e $__p9k_cfg_path ]]; then
|
|
|
|
if [[ -e $__p9k_cfg_path ]]; then
|
|
|
|
zf_rm -f -- $__p9k_cfg_path || return
|
|
|
|
unlink $__p9k_cfg_path || return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
print -lr -- "$header" "$lines[@]" >$__p9k_cfg_path
|
|
|
|
print -lr -- "$header" "$lines[@]" >$__p9k_cfg_path
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2009,84 +1951,16 @@ fi" || return
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function check_zshrc_integration() {
|
|
|
|
|
|
|
|
typeset -g zshrc_content=
|
|
|
|
|
|
|
|
typeset -gi zshrc_has_cfg=0 zshrc_has_instant_prompt=0
|
|
|
|
|
|
|
|
[[ -e $__p9k_zshrc ]] || return 0
|
|
|
|
|
|
|
|
zshrc_content="$(<$__p9k_zshrc)" || return
|
|
|
|
|
|
|
|
local lines=(${(f)zshrc_content})
|
|
|
|
|
|
|
|
local f0=$__p9k_cfg_path_o
|
|
|
|
|
|
|
|
local f1=${(q)f0}
|
|
|
|
|
|
|
|
local f2=${(q-)f0}
|
|
|
|
|
|
|
|
local f3=${(qq)f0}
|
|
|
|
|
|
|
|
local f4=${(qqq)f0}
|
|
|
|
|
|
|
|
local g1=${${(q)__p9k_cfg_path_o}/#(#b)${(q)HOME}\//'~/'}
|
|
|
|
|
|
|
|
local h0='${ZDOTDIR:-~}/.p10k.zsh'
|
|
|
|
|
|
|
|
local h1='${ZDOTDIR:-$HOME}/.p10k.zsh'
|
|
|
|
|
|
|
|
local h2='"${ZDOTDIR:-$HOME}/.p10k.zsh"'
|
|
|
|
|
|
|
|
local h3='"${ZDOTDIR:-$HOME}"/.p10k.zsh'
|
|
|
|
|
|
|
|
local h4='${ZDOTDIR}/.p10k.zsh'
|
|
|
|
|
|
|
|
local h5='"${ZDOTDIR}/.p10k.zsh"'
|
|
|
|
|
|
|
|
local h6='"${ZDOTDIR}"/.p10k.zsh'
|
|
|
|
|
|
|
|
local h7='$ZDOTDIR/.p10k.zsh'
|
|
|
|
|
|
|
|
local h8='"$ZDOTDIR/.p10k.zsh"'
|
|
|
|
|
|
|
|
local h9='"$ZDOTDIR"/.p10k.zsh'
|
|
|
|
|
|
|
|
local h10='$POWERLEVEL9K_CONFIG_FILE'
|
|
|
|
|
|
|
|
local h11='"$POWERLEVEL9K_CONFIG_FILE"'
|
|
|
|
|
|
|
|
if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##(|--[[:space:]]##)($f1|$f2|$f3|$f4|$g1|$h0|$h1|$h2|$h3|$h4|$h5|$h6|$h7|$h8|$h9|$h10|$h11)(|[[:space:]]*|'#'*)} ]]; then
|
|
|
|
|
|
|
|
zshrc_has_cfg=1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
local pre='${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh'
|
|
|
|
|
|
|
|
if [[ -n ${(@M)lines:#(#b)[^#]#([^[:IDENT:]]|)source[[:space:]]##($pre|\"$pre\")(|[[:space:]]*|'#'*)} ]]; then
|
|
|
|
|
|
|
|
zshrc_has_instant_prompt=1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
() {
|
|
|
|
|
|
|
|
(( force )) && return
|
|
|
|
|
|
|
|
_p9k_can_configure -q || return 0
|
|
|
|
|
|
|
|
local zshrc_content zshrc_has_cfg zshrc_has_instant_prompt
|
|
|
|
|
|
|
|
check_zshrc_integration 2>/dev/null || return 0
|
|
|
|
|
|
|
|
(( zshrc_has_cfg )) || return 0
|
|
|
|
|
|
|
|
[[ -s $__p9k_cfg_path ]] || return 0
|
|
|
|
|
|
|
|
print -P ""
|
|
|
|
|
|
|
|
flowing \
|
|
|
|
|
|
|
|
Powerlevel10k configuration file "($__p9k_cfg_path_u)" was not sourced. This \
|
|
|
|
|
|
|
|
might have been caused by errors in zsh startup files, most likely in \
|
|
|
|
|
|
|
|
$__p9k_zshrc_u. See above for any indication of such errors and fix them. If \
|
|
|
|
|
|
|
|
there are no errors, try running Powerlevel10k configuration wizard:
|
|
|
|
|
|
|
|
print -P ''
|
|
|
|
|
|
|
|
print -P ' %2Fp10k%f %Bconfigure%b'
|
|
|
|
|
|
|
|
print -P ''
|
|
|
|
|
|
|
|
flowing \
|
|
|
|
|
|
|
|
If you do nothing, you will see this message again when you start zsh. You can \
|
|
|
|
|
|
|
|
suppress it by defining %BPOWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true%b in \
|
|
|
|
|
|
|
|
$__p9k_zshrc_u.
|
|
|
|
|
|
|
|
print -P ''
|
|
|
|
|
|
|
|
return 1
|
|
|
|
|
|
|
|
} || return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (( $+terminfo[smcup] && $+terminfo[rmcup] )) && echoti smcup 2>/dev/null; then
|
|
|
|
|
|
|
|
function restore_screen() {
|
|
|
|
|
|
|
|
echoti rmcup 2>/dev/null
|
|
|
|
|
|
|
|
function restore_screen() {}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
function restore_screen() {}
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ # always
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (( force )); then
|
|
|
|
if (( force )); then
|
|
|
|
_p9k_can_configure || return
|
|
|
|
_p9k_can_configure || return
|
|
|
|
else
|
|
|
|
else
|
|
|
|
_p9k_can_configure -q || return
|
|
|
|
_p9k_can_configure -q || return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
zmodload zsh/terminfo zsh/datetime || return
|
|
|
|
zmodload zsh/terminfo || return
|
|
|
|
|
|
|
|
autoload -Uz is-at-least || return
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $ZSH_VERSION == (5.7.<1->*|5.<8->*|<6->.*) && $COLORTERM == (24bit|truecolor) ]]; then
|
|
|
|
if is-at-least 5.7.1 && [[ $COLORTERM == (24bit|truecolor) ]]; then
|
|
|
|
local -ir has_truecolor=1
|
|
|
|
local -ir has_truecolor=1
|
|
|
|
else
|
|
|
|
else
|
|
|
|
local -ir has_truecolor=0
|
|
|
|
local -ir has_truecolor=0
|
|
|
@ -2101,7 +1975,7 @@ while true; do
|
|
|
|
local gap_char=' ' prompt_char='❯' down_triangle='\uE0BC' up_triangle='\uE0BA' slanted_bar='\u2571'
|
|
|
|
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 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 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_arrow=0 cap_lock=0 cap_quotes=0
|
|
|
|
local -i cap_diamond=0 cap_python=0 cap_debian=0 cap_lock=0 cap_arrow=0
|
|
|
|
local -a extra_icons=('' '' '')
|
|
|
|
local -a extra_icons=('' '' '')
|
|
|
|
local -a frame_color=(244 242 240 238)
|
|
|
|
local -a frame_color=(244 242 240 238)
|
|
|
|
local -a color_name=(Lightest Light Dark Darkest)
|
|
|
|
local -a color_name=(Lightest Light Dark Darkest)
|
|
|
@ -2115,7 +1989,7 @@ while true; do
|
|
|
|
|
|
|
|
|
|
|
|
unset pure_use_rprompt
|
|
|
|
unset pure_use_rprompt
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -o multibyte && $TERM != (dumb|linux) && $langinfo[CODESET] == (utf|UTF)(-|)8 ]]; then
|
|
|
|
if [[ $TERM != (dumb|linux) && $langinfo[CODESET] == (utf|UTF)(-|)8 ]]; then
|
|
|
|
ask_font || continue
|
|
|
|
ask_font || continue
|
|
|
|
ask_diamond || continue
|
|
|
|
ask_diamond || continue
|
|
|
|
if [[ $AWESOME_GLYPHS_LOADED == 1 ]]; then
|
|
|
|
if [[ $AWESOME_GLYPHS_LOADED == 1 ]]; then
|
|
|
@ -2135,27 +2009,19 @@ while true; do
|
|
|
|
if (( cap_diamond )); then
|
|
|
|
if (( cap_diamond )); then
|
|
|
|
POWERLEVEL9K_MODE=powerline
|
|
|
|
POWERLEVEL9K_MODE=powerline
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ask_quotes || continue
|
|
|
|
ask_arrow || continue
|
|
|
|
(( cap_quotes )) && POWERLEVEL9K_MODE=compatible || POWERLEVEL9K_MODE=ascii
|
|
|
|
(( cap_arrow )) && POWERLEVEL9K_MODE=compatible || POWERLEVEL9K_MODE=ascii
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
elif (( ! cap_diamond )); then
|
|
|
|
elif (( ! cap_diamond )); then
|
|
|
|
POWERLEVEL9K_MODE=awesome-fontconfig
|
|
|
|
POWERLEVEL9K_MODE=awesome-fontconfig
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ask_arrow '\UF0737' || continue
|
|
|
|
ask_debian || continue
|
|
|
|
if (( cap_arrow )); then
|
|
|
|
if (( cap_debian )); then
|
|
|
|
ask_width || continue
|
|
|
|
POWERLEVEL9K_MODE=nerdfont-complete
|
|
|
|
fi
|
|
|
|
|
|
|
|
if (( cap_arrow )); then
|
|
|
|
|
|
|
|
POWERLEVEL9K_MODE=nerdfont-v3
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ask_arrow '\uFC35' "Let's try another one." || continue
|
|
|
|
POWERLEVEL9K_MODE=awesome-fontconfig
|
|
|
|
if (( cap_arrow )); then
|
|
|
|
ask_python || continue
|
|
|
|
POWERLEVEL9K_MODE=nerdfont-complete
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
POWERLEVEL9K_MODE=awesome-fontconfig
|
|
|
|
|
|
|
|
ask_python || continue
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -2227,12 +2093,12 @@ restore_screen
|
|
|
|
if (( !in_z4h_wizard )); then
|
|
|
|
if (( !in_z4h_wizard )); then
|
|
|
|
print
|
|
|
|
print
|
|
|
|
|
|
|
|
|
|
|
|
flowing +c New config: "%U${__p9k_cfg_path_u//\\/\\\\}%u."
|
|
|
|
flowing +c New config: "%B${__p9k_cfg_path_u//\\/\\\\}%b."
|
|
|
|
if [[ -n $config_backup ]]; then
|
|
|
|
if [[ -n $config_backup ]]; then
|
|
|
|
flowing +c Backup of the old config: "%U${config_backup_u//\\/\\\\}%u."
|
|
|
|
flowing +c Backup of the old config: "%B${config_backup_u//\\/\\\\}%b."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ -n $zshrc_backup ]]; then
|
|
|
|
if [[ -n $zshrc_backup ]]; then
|
|
|
|
flowing +c Backup of "%U${__p9k_zshrc_u//\\/\\\\}%u:" "%U${zshrc_backup_u//\\/\\\\}%u."
|
|
|
|
flowing +c Backup of "%B${__p9k_zshrc_u//\\/\\\\}%b:" "%B${zshrc_backup_u//\\/\\\\}%b."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|