add direnv segment; fixes 291

pull/298/head
romkatv 5 years ago
parent 6096321f61
commit f722f3d1ce

@ -44,6 +44,7 @@
status # exit code of the last command status # exit code of the last command
command_execution_time # duration of the last command command_execution_time # duration of the last command
background_jobs # presence of background jobs background_jobs # presence of background jobs
direnv # direnv status (https://direnv.net/)
virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
anaconda # conda environment (https://conda.io/) anaconda # conda environment (https://conda.io/)
pyenv # python environment (https://github.com/pyenv/pyenv) pyenv # python environment (https://github.com/pyenv/pyenv)
@ -490,6 +491,12 @@
# Icon to show when there are background jobs. # Icon to show when there are background jobs.
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}' typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'
#######################[ direnv: direnv status (https://direnv.net/) ]########################
# Direnv color.
typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178
# Icon to show when direnv is active.
typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'
##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
# NordVPN connection indicator color. # NordVPN connection indicator color.
typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39

@ -44,6 +44,7 @@
status # exit code of the last command status # exit code of the last command
command_execution_time # duration of the last command command_execution_time # duration of the last command
background_jobs # presence of background jobs background_jobs # presence of background jobs
direnv # direnv status (https://direnv.net/)
virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
anaconda # conda environment (https://conda.io/) anaconda # conda environment (https://conda.io/)
pyenv # python environment (https://github.com/pyenv/pyenv) pyenv # python environment (https://github.com/pyenv/pyenv)
@ -470,6 +471,12 @@
# Icon to show when there are background jobs. # Icon to show when there are background jobs.
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⇶' typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⇶'
#######################[ direnv: direnv status (https://direnv.net/) ]########################
# Direnv color.
typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178
# Icon to show when direnv is active.
typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'
##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
# NordVPN connection indicator color. # NordVPN connection indicator color.
typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39

@ -44,6 +44,7 @@
status # exit code of the last command status # exit code of the last command
command_execution_time # duration of the last command command_execution_time # duration of the last command
background_jobs # presence of background jobs background_jobs # presence of background jobs
direnv # direnv status (https://direnv.net/)
virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
anaconda # conda environment (https://conda.io/) anaconda # conda environment (https://conda.io/)
pyenv # python environment (https://github.com/pyenv/pyenv) pyenv # python environment (https://github.com/pyenv/pyenv)
@ -486,6 +487,13 @@
# Icon to show when there are background jobs. # Icon to show when there are background jobs.
typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}' typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'
#######################[ direnv: direnv status (https://direnv.net/) ]########################
# Direnv color.
# typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3
# typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0
# Icon to show when direnv is active.
typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'
##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
# NordVPN connection indicator color. # NordVPN connection indicator color.
# typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 # typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7

@ -114,7 +114,8 @@ function _p9k_init_icons() {
TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️
PROXY_ICON '\u2B82' # ⮂ PROXY_ICON '\u2B82' # ⮂
DOTNET_ICON '.NET' DOTNET_ICON '.NET'
AZURE_ICON '\u2601' # ☁ AZURE_ICON '\u2601' # ☁
DIRENV_ICON '\u25BC' # ▼
) )
;; ;;
'awesome-fontconfig') 'awesome-fontconfig')
@ -216,7 +217,8 @@ function _p9k_init_icons() {
TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️
PROXY_ICON '\u2B82' # ⮂ PROXY_ICON '\u2B82' # ⮂
DOTNET_ICON '.NET' DOTNET_ICON '.NET'
AZURE_ICON '\u2601' # ☁ AZURE_ICON '\u2601' # ☁
DIRENV_ICON '\u25BC' # ▼
) )
;; ;;
'awesome-mapped-fontconfig') 'awesome-mapped-fontconfig')
@ -323,6 +325,7 @@ function _p9k_init_icons() {
PROXY_ICON '\u2B82' # ⮂ PROXY_ICON '\u2B82' # ⮂
DOTNET_ICON '.NET' DOTNET_ICON '.NET'
AZURE_ICON '\u2601' # ☁ AZURE_ICON '\u2601' # ☁
DIRENV_ICON '\u25BC' # ▼
) )
;; ;;
'nerdfont-complete'|'nerdfont-fontconfig') 'nerdfont-complete'|'nerdfont-fontconfig')
@ -426,6 +429,7 @@ function _p9k_init_icons() {
PROXY_ICON '\u2B82' # ⮂ PROXY_ICON '\u2B82' # ⮂
DOTNET_ICON '\uE77F' #  DOTNET_ICON '\uE77F' # 
AZURE_ICON '\uFD03' # ﴃ AZURE_ICON '\uFD03' # ﴃ
DIRENV_ICON '\u25BC' # ▼
) )
;; ;;
*) *)
@ -446,7 +450,7 @@ function _p9k_init_icons() {
AWS_EB_ICON '\U1F331' # 🌱 AWS_EB_ICON '\U1F331' # 🌱
BACKGROUND_JOBS_ICON '\u2699' # ⚙ BACKGROUND_JOBS_ICON '\u2699' # ⚙
TEST_ICON '' TEST_ICON ''
TODO_ICON '\u2611' # ☑ (portable alternatives: ∆) TODO_ICON '\u2611' # ☑ (portable alternative: ∆)
BATTERY_ICON '\U1F50B' # 🔋 BATTERY_ICON '\U1F50B' # 🔋
DISK_ICON 'hdd' DISK_ICON 'hdd'
OK_ICON '\u2714' # ✔ OK_ICON '\u2714' # ✔
@ -525,9 +529,10 @@ function _p9k_init_icons() {
LARAVEL_ICON '' LARAVEL_ICON ''
RANGER_ICON '\u2B50' # ⭐ RANGER_ICON '\u2B50' # ⭐
TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️
PROXY_ICON '\u2B82' # ⮂ PROXY_ICON '\u2194' # ↔
DOTNET_ICON '.NET' DOTNET_ICON '.NET'
AZURE_ICON '\u2601' # ☁ AZURE_ICON '\u2601' # ☁
DIRENV_ICON '\u25BC' # ▼
) )
;; ;;
esac esac

@ -3347,6 +3347,12 @@ function prompt_proxy() {
_p9k_prompt_segment $0 $_p9k_color1 blue PROXY_ICON 0 '' "$p[1]" _p9k_prompt_segment $0 $_p9k_color1 blue PROXY_ICON 0 '' "$p[1]"
} }
function prompt_direnv() {
_p9k_prompt_segment $0 $_p9k_color1 yellow DIRENV_ICON 0 '$DIRENV_DIR' ''
}
function instant_prompt_direnv() { prompt_direnv; }
_p9k_preexec() { _p9k_preexec() {
if (( $+_p9k_real_zle_rprompt_indent )); then if (( $+_p9k_real_zle_rprompt_indent )); then
if [[ -n $_p9k_real_zle_rprompt_indent ]]; then if [[ -n $_p9k_real_zle_rprompt_indent ]]; then

Loading…
Cancel
Save