1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-21 20:00:07 +00:00

feature: added perlbrew

This commit is contained in:
Lucas Burns 2022-02-26 20:27:19 -06:00
parent 123136c0e7
commit b898d1de15
No known key found for this signature in database
GPG key ID: C011CBEF6628B679
5 changed files with 72 additions and 0 deletions

View file

@ -65,6 +65,7 @@
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
jenv # java version from jenv (https://github.com/jenv/jenv) jenv # java version from jenv (https://github.com/jenv/jenv)
plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 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) phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
haskell_stack # haskell version from stack (https://haskellstack.org/) haskell_stack # haskell version from stack (https://haskellstack.org/)
@ -1133,6 +1134,18 @@
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # 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) ]############ ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
# PHP color. # PHP color.
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99 typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99

View file

@ -65,6 +65,7 @@
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
jenv # java version from jenv (https://github.com/jenv/jenv) jenv # java version from jenv (https://github.com/jenv/jenv)
plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 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) phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
haskell_stack # haskell version from stack (https://haskellstack.org/) haskell_stack # haskell version from stack (https://haskellstack.org/)
@ -1114,6 +1115,18 @@
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # 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) ]############ ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
# PHP color. # PHP color.
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=5 typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=5

View file

@ -65,6 +65,7 @@
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
jenv # java version from jenv (https://github.com/jenv/jenv) jenv # java version from jenv (https://github.com/jenv/jenv)
plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 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) phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
haskell_stack # haskell version from stack (https://haskellstack.org/) haskell_stack # haskell version from stack (https://haskellstack.org/)
@ -1110,6 +1111,18 @@
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # 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) ]############ ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
# PHP color. # PHP color.
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99 typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99

View file

@ -65,6 +65,7 @@
luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
jenv # java version from jenv (https://github.com/jenv/jenv) jenv # java version from jenv (https://github.com/jenv/jenv)
plenv # perl version from plenv (https://github.com/tokuhirom/plenv) 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) phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
haskell_stack # haskell version from stack (https://haskellstack.org/) haskell_stack # haskell version from stack (https://haskellstack.org/)
@ -1194,6 +1195,18 @@
# Custom icon. # Custom icon.
# typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # 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) ]############ ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
# PHP color. # PHP color.
typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0

View file

@ -3115,6 +3115,26 @@ _p9k_prompt_plenv_init() {
typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${commands[plenv]:-${${+functions[plenv]}:#0}}' 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 # Segment to display chruby information
# see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH # see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH