aboutsummaryrefslogtreecommitdiff
path: root/internal/wizard.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-10-10 15:14:08 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-10-10 15:14:08 +0300
commit640d513554c5534009408326066dd0e8eebc586c (patch)
tree6b45b2f9a555d707e27a266fbb1cb94ed3a600a8 /internal/wizard.zsh
parent40c062c3b95a7bd08e6cb89a38d902e4758dd1e1 (diff)
add pure style to the configuration wizard
Diffstat (limited to 'internal/wizard.zsh')
-rwxr-xr-xinternal/wizard.zsh52
1 files changed, 40 insertions, 12 deletions
diff --git a/internal/wizard.zsh b/internal/wizard.zsh
index a2e078eb..5c25f6a5 100755
--- a/internal/wizard.zsh
+++ b/internal/wizard.zsh
@@ -80,6 +80,16 @@ typeset -ra classic_right=(
'' '%$frame_color[$color]F─╯%f'
)
+typeset -ra pure_left=(
+ '' '%4F~/src%f %242Fmaster%f'
+ '' '%5F❯%f █'
+)
+
+typeset -ra pure_right=(
+ '' ''
+ '' ''
+)
+
function prompt_length() {
local COLUMNS=1024
local -i x y=$#1 m
@@ -531,17 +541,22 @@ function ask_style() {
print -P ""
style=classic print_prompt
print -P ""
+ print -P "%B(3) Pure.%b"
+ print -P ""
+ style=pure print_prompt
+ print -P ""
print -P "(r) Restart from the beginning."
print -P "(q) Quit and do nothing."
print -P ""
local key=
- read -k key${(%):-"?%BChoice [12rq]: %b"} || quit -c
+ read -k key${(%):-"?%BChoice [123rq]: %b"} || quit -c
case $key in
q) quit;;
r) return 1;;
1) style=lean; options+=lean; break;;
2) style=classic; options+=classic; break;;
+ 3) style=pure; options+=pure; break;;
esac
done
}
@@ -1190,6 +1205,14 @@ function ask_config_overwrite() {
}
function generate_config() {
+ if [[ $style == pure ]]; then
+ if [[ -e $__p9k_cfg_path ]]; then
+ unlink $__p9k_cfg_path || return
+ fi
+ cp $__p9k_root_dir/config/p10k-$style.zsh $__p9k_cfg_path || return
+ return
+ fi
+
local base && base="$(<$__p9k_root_dir/config/p10k-$style.zsh)" || return
local lines=("${(@f)base}")
@@ -1444,17 +1467,22 @@ while true; do
_p9k_init_icons
ask_narrow_icons || continue
ask_style || continue
- ask_color || continue
- ask_time || continue
- ask_separators || continue
- ask_heads || continue
- ask_tails || continue
- ask_num_lines || continue
- ask_gap_char || continue
- ask_frame || continue
- ask_empty_line || continue
- ask_extra_icons || continue
- ask_prefixes || continue
+ if [[ $style == pure ]]; then
+ empty_line=1
+ options+='sparse'
+ else
+ ask_color || continue
+ ask_time || continue
+ ask_separators || continue
+ ask_heads || continue
+ ask_tails || continue
+ ask_num_lines || continue
+ ask_gap_char || continue
+ ask_frame || continue
+ ask_empty_line || continue
+ ask_extra_icons || continue
+ ask_prefixes || continue
+ fi
ask_confirm || continue
ask_config_overwrite || continue
break