From b898d1de150c1dd26da2d0b0376ae7b517b9665f Mon Sep 17 00:00:00 2001 From: Lucas Burns Date: Sat, 26 Feb 2022 20:27:19 -0600 Subject: feature: added perlbrew --- internal/p10k.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'internal/p10k.zsh') diff --git a/internal/p10k.zsh b/internal/p10k.zsh index cc36eb0d..9f5b4de9 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3115,6 +3115,26 @@ _p9k_prompt_plenv_init() { typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${commands[plenv]:-${${+functions[plenv]}:#0}}' } +################################################################ +# Segment to display perlbrew information +# https://github.com/gugod/App-perlbrew + +prompt_perlbrew() { + [[ -n $PERLBREW_PERL && ( -v commands[perlbrew] || -v functions[perlbrew] ) ]] || return + if (( _POWERLEVEL9K_PERLBREW_PROJECT_ONLY )); then + _p9k_upglob 'cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)' && return + fi + + local v=$PERLBREW_PERL + (( _POWERLEVEL9K_PERLBREW_SHOW_PREFIX )) || v=${v#*-} + [[ -n $v ]] || return + _p9k_prompt_segment "$0" "blue" "$_p9k_color1" 'PERL_ICON' 0 '' "${v//\%/%%}" +} + +_p9k_prompt_perlbrew_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${commands[perlbrew]:-${${+functions[perlbrew]}:#0}}' +} + ################################################################ # Segment to display chruby information # see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH -- cgit v1.2.3 From 40a5cdfa6cf20af0133f888be095198ea49d41a1 Mon Sep 17 00:00:00 2001 From: Lucas Burns Date: Sat, 26 Feb 2022 20:32:53 -0600 Subject: chore: forgot to add global variables to main --- internal/p10k.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'internal/p10k.zsh') diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9f5b4de9..2cf35ad5 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -7451,6 +7451,8 @@ _p9k_init_params() { _p9k_declare -b POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY 1 _p9k_declare -b POWERLEVEL9K_GO_VERSION_PROJECT_ONLY 1 _p9k_declare -b POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY 1 + _p9k_declare -b POWERLEVEL9K_PERLBREW_PROJECT_ONLY 1 + _p9k_declare -b POWERLEVEL9K_PERLBREW_SHOW_PREFIX 0 _p9k_declare -b POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY 0 _p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -a POWERLEVEL9K_NODENV_SOURCES -- shell local global -- cgit v1.2.3