From e4849cc431f7c375577d6f306f476dc9267da132 Mon Sep 17 00:00:00 2001 From: romkatv Date: Wed, 31 Jul 2019 12:44:49 +0200 Subject: [PATCH 1/3] hack wizard to create a screenshot --- internal/configure.zsh | 4 +- internal/wizard.zsh | 96 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 96 insertions(+), 4 deletions(-) diff --git a/internal/configure.zsh b/internal/configure.zsh index 9e676183..924a75d1 100644 --- a/internal/configure.zsh +++ b/internal/configure.zsh @@ -1,5 +1,5 @@ -typeset -gr __p9k_wizard_columns=76 -typeset -gr __p9k_wizard_lines=21 +typeset -gr __p9k_wizard_columns=70 # DO NOT SUBMIT: 76 +typeset -gr __p9k_wizard_lines=20 # DO NOT SUBMIT: 21 typeset -gr __p9k_zd=${${ZDOTDIR:-$HOME}:A} typeset -gr __p9k_zd_u=${${(q-)__p9k_zd}/#(#b)$HOME(|\/*)/'~'$match[1]} typeset -gr __p9k_cfg_basename=.p10k.zsh diff --git a/internal/wizard.zsh b/internal/wizard.zsh index d8ca2efd..7c94934d 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -31,7 +31,8 @@ typeset -gri force source $__p9k_root_dir/internal/configure.zsh || return -typeset -ri prompt_indent=2 +typeset -i prompt_indent=2 +typeset -i rprompt_indent=2 typeset -ra bg_color=(238 236 234) typeset -ra frame_color=(242 240 238) @@ -104,7 +105,7 @@ function print_prompt() { for ((i = 1; i < $#left; i+=2)); do local l=${(g::):-$left[i]$left[i+1]} local r=${(g::):-$right[i]$right[i+1]} - local -i gap=$((__p9k_wizard_columns - 2 * prompt_indent - $(prompt_length $l$r))) + local -i gap=$((__p9k_wizard_columns - prompt_indent - rprompt_indent - $(prompt_length $l$r))) (( num_lines == 2 && i == 1 )) && local fill=$gap_char || local fill=' ' print -n -- ${(pl:$prompt_indent:: :)} print -nP -- $l @@ -992,6 +993,97 @@ while true; do fi _p9k_init_icons ask_narrow_icons || continue + + local dir_icon=${(g::)icons[HOME_SUB_ICON]} + local vcs_icon=${(g::)icons[VCS_GIT_GITHUB_ICON]} + local branch_icon=${(g::)icons[VCS_BRANCH_ICON]} + if (( cap_narrow_icons )); then + dir_icon=${dir_icon// } + vcs_icon=${vcs_icon// } + branch_icon=${branch_icon// } + fi + local many=("$dir_icon " "$vcs_icon $branch_icon ") + + # Set screen size to 70x20, run p9k_configure, answer 'yyny'. + reset + echo + centered "Lean Style" + ( + style=lean + num_lines=1 + prompt_indent=4 + rprompt_indent=4 + echo + print_prompt + ) + echo + ( + style=lean + extra_icons=($many) + prefixes=('on ' 'at ') + num_lines=2 + prompt_indent=4 + rprompt_indent=4 + echo + print_prompt + ) + echo + centered "Classic Style" + ( + style=classic + num_lines=1 + prompt_indent=4 + rprompt_indent=4 + echo + print_prompt + ) + echo + ( + style=classic + num_lines=2 + # slanted sep + left_sep=$down_triangle + right_sep=$up_triangle + left_subsep=$slanted_bar + right_subsep=$slanted_bar + # blurred heads + left_head=$fade_out; right_head=$fade_in; + # blurred tails + left_tail=$fade_in; right_tail=$fade_out; + gap_char="·" + prompt_indent=2 + rprompt_indent=2 + echo + print_prompt + ) + ( + style=classic + num_lines=2 + # slanted sep + left_sep=$down_triangle + right_sep=$up_triangle + left_subsep=$slanted_bar + right_subsep=$slanted_bar + # slanted heads + left_head=$down_triangle + right_head=$up_triangle + # slanted tails + left_tail=$up_triangle + right_tail=$down_triangle + # gap_char="·" + # gap_char="─" + left_frame=0; right_frame=1 + extra_icons=($many) + prompt_indent=4 + rprompt_indent=2 + echo + print_prompt + ) + tput civis + read + tput cnorm + return 1 + ask_style || continue ask_color || continue ask_separators || continue From 4e4dd929c38491dae92ffdc90317b1dab361f50a Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 12 Oct 2019 13:02:11 +0200 Subject: [PATCH 2/3] add rainbow style to the screenshot --- internal/wizard.zsh | 62 ++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 77b72b2f..5463abaf 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1552,22 +1552,25 @@ while true; do _p9k_init_icons ask_narrow_icons || continue - local dir_icon=${(g::)icons[HOME_SUB_ICON]} - local vcs_icon=${(g::)icons[VCS_GIT_GITHUB_ICON]} - local branch_icon=${(g::)icons[VCS_BRANCH_ICON]} - if (( cap_narrow_icons )); then - dir_icon=${dir_icon// } - vcs_icon=${vcs_icon// } - branch_icon=${branch_icon// } - fi - local many=("$dir_icon " "$vcs_icon $branch_icon ") + # Set screen size to 80x25, run `p10k configure`, answer "yyyy22". + local few_icons=("$extra_icons[@]") + ask_extra_icons || continue + local many_icons=("$extra_icons[@]") + + local concise=("$prefixes[@]") + ask_prefixes || continue + local fluent=("$prefixes[@]") + + color=3 - # Set screen size to 70x20, run p9k_configure, answer 'yyny'. reset echo - centered "Lean Style" + flowing -c "Lean Style" ( style=lean + extra_icons=("$few_icons[@]") + prefixes=("$concise[@]") + show_time= num_lines=1 prompt_indent=4 rprompt_indent=4 @@ -1577,8 +1580,9 @@ while true; do echo ( style=lean - extra_icons=($many) - prefixes=('on ' 'at ') + extra_icons=("$many_icons[@]") + prefixes=("$fluent[@]") + show_time=1 num_lines=2 prompt_indent=4 rprompt_indent=4 @@ -1586,9 +1590,12 @@ while true; do print_prompt ) echo - centered "Classic Style" + flowing -c "Classic Style" ( style=classic + extra_icons=("$few_icons[@]") + prefixes=("$concise[@]") + show_time= num_lines=1 prompt_indent=4 rprompt_indent=4 @@ -1598,6 +1605,9 @@ while true; do echo ( style=classic + extra_icons=("$many_icons[@]") + prefixes=("$fluent[@]") + show_time=1 num_lines=2 # slanted sep left_sep=$down_triangle @@ -1614,8 +1624,25 @@ while true; do echo print_prompt ) + echo + flowing -c "Rainbow Style" ( - style=classic + style=rainbow + extra_icons=("$few_icons[@]") + prefixes=("$concise[@]") + show_time= + num_lines=1 + prompt_indent=4 + rprompt_indent=4 + echo + print_prompt + ) + echo + ( + style=rainbow + extra_icons=("$many_icons[@]") + prefixes=("$fluent[@]") + show_time=1 num_lines=2 # slanted sep left_sep=$down_triangle @@ -1629,17 +1656,16 @@ while true; do left_tail=$up_triangle right_tail=$down_triangle # gap_char="·" - # gap_char="─" + gap_char="─" left_frame=0; right_frame=1 - extra_icons=($many) prompt_indent=4 rprompt_indent=2 echo print_prompt ) tput civis + trap 'tput cnorm' EXIT INT read - tput cnorm return 1 ask_style || continue From 55fa67aec0d80cabf327570b05774abe7604b6ff Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 30 Jan 2020 13:22:59 +0100 Subject: [PATCH 3/3] mention font size --- internal/wizard.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 5463abaf..7e467216 100755 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1553,6 +1553,7 @@ while true; do ask_narrow_icons || continue # Set screen size to 80x25, run `p10k configure`, answer "yyyy22". + # gsettings set org.gnome.desktop.interface monospace-font-name 'MesloLGS NF 48' local few_icons=("$extra_icons[@]") ask_extra_icons || continue local many_icons=("$extra_icons[@]")