aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-02-28 12:24:10 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-02-28 12:24:10 +0300
commit73698935b817929cf980274e7e4796d1364fdfb6 (patch)
tree9c763934572d4892be4a8c06987e8bc8e6ce7197
parent123136c0e7566a2a12385f3836e3e92df6b42be1 (diff)
parent40a5cdfa6cf20af0133f888be095198ea49d41a1 (diff)
Merge branch 'lmburns-perlbrew'
-rw-r--r--config/p10k-classic.zsh13
-rw-r--r--config/p10k-lean-8colors.zsh13
-rw-r--r--config/p10k-lean.zsh13
-rw-r--r--config/p10k-rainbow.zsh13
-rw-r--r--internal/p10k.zsh22
5 files changed, 74 insertions, 0 deletions
diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh
index 21ca0155..88a8b96d 100644
--- a/config/p10k-classic.zsh
+++ b/config/p10k-classic.zsh
@@ -65,6 +65,7 @@
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
jenv # java version from jenv (https://github.com/jenv/jenv)
plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
+ perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew)
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
haskell_stack # haskell version from stack (https://haskellstack.org/)
@@ -1133,6 +1134,18 @@
# Custom icon.
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############
+ # Perlbrew color.
+ typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67
+ # Show perlbrew version only when in a perl project subdirectory.
+ typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true
+ # Don't show perl- at the front.
+ typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false
+ # Decide what should show perlbrew
+ # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)'
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐'
+
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
# PHP color.
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99
diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh
index dc96d4df..1f1e8680 100644
--- a/config/p10k-lean-8colors.zsh
+++ b/config/p10k-lean-8colors.zsh
@@ -65,6 +65,7 @@
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
jenv # java version from jenv (https://github.com/jenv/jenv)
plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
+ perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew)
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
haskell_stack # haskell version from stack (https://haskellstack.org/)
@@ -1114,6 +1115,18 @@
# Custom icon.
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############
+ # Perlbrew color.
+ typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67
+ # Show perlbrew version only when in a perl project subdirectory.
+ typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true
+ # Don't show perl- at the front.
+ typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false
+ # Decide what should show perlbrew
+ # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)'
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐'
+
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
# PHP color.
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=5
diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh
index fc3f20d7..d37f5ba3 100644
--- a/config/p10k-lean.zsh
+++ b/config/p10k-lean.zsh
@@ -65,6 +65,7 @@
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
jenv # java version from jenv (https://github.com/jenv/jenv)
plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
+ perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew)
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
haskell_stack # haskell version from stack (https://haskellstack.org/)
@@ -1110,6 +1111,18 @@
# Custom icon.
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############
+ # Perlbrew color.
+ typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67
+ # Show perlbrew version only when in a perl project subdirectory.
+ typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true
+ # Don't show perl- at the front.
+ typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false
+ # Decide what should show perlbrew
+ # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)'
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐'
+
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
# PHP color.
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99
diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh
index ef5b444e..5545add2 100644
--- a/config/p10k-rainbow.zsh
+++ b/config/p10k-rainbow.zsh
@@ -65,6 +65,7 @@
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
jenv # java version from jenv (https://github.com/jenv/jenv)
plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
+ perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew)
phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
haskell_stack # haskell version from stack (https://haskellstack.org/)
@@ -1194,6 +1195,18 @@
# Custom icon.
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############
+ # Perlbrew color.
+ typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67
+ # Show perlbrew version only when in a perl project subdirectory.
+ typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true
+ # Don't show perl- at the front.
+ typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false
+ # Decide what should show perlbrew
+ # typeset -g POWERLEVEL9K_PERLBREW_SHOW_ON_UPGLOB='cpanfile|(MY|)META.(yml|json)|.perltidyrc|(Makefile|Build).PL|*.(pl|pm|t|pod)'
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐'
+
############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
# PHP color.
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index cc36eb0d..2cf35ad5 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -3116,6 +3116,26 @@ _p9k_prompt_plenv_init() {
}
################################################################
+# 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
prompt_chruby() {
@@ -7431,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