From 3340dc7269cc44bda4e6f03dc8e0daaff3e22556 Mon Sep 17 00:00:00 2001 From: romkatv Date: Sun, 1 Dec 2019 12:14:24 +0100 Subject: [PATCH] new prompt segment: midnignt_commander (see #342) --- config/p10k-classic.zsh | 7 +++++++ config/p10k-lean.zsh | 7 +++++++ config/p10k-rainbow.zsh | 8 ++++++++ internal/icons.zsh | 5 +++++ internal/p10k.zsh | 9 +++++++++ 5 files changed, 36 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 9aa112c3..882a7f18 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -68,6 +68,7 @@ context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) + # midnight_commander # midnight commander shell (https://midnight-commander.org/) vi_mode # vi mode (you don't need this if you've enabled prompt_char) # vpn_ip # virtual private network indicator # ram # free RAM @@ -517,6 +518,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=178 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### # Text and color for normal (a.k.a. command) vi mode. typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 01f5a6fe..0a7e58bd 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -68,6 +68,7 @@ context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) + # midnight_commander # midnight commander shell (https://midnight-commander.org/) # vpn_ip # virtual private network indicator # ram # free RAM # load # CPU load @@ -510,6 +511,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=178 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################################[ ram: free RAM ]####################################### # RAM color. typeset -g POWERLEVEL9K_RAM_FOREGROUND=66 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index 0ee0333b..ce0f89dd 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -68,6 +68,7 @@ context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) + # midnight_commander # midnight commander shell (https://midnight-commander.org/) vi_mode # vi mode (you don't need this if you've enabled prompt_char) # vpn_ip # virtual private network indicator # ram # free RAM @@ -516,6 +517,13 @@ # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### # Foreground color. typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 diff --git a/internal/icons.zsh b/internal/icons.zsh index 8bef2168..17d6341b 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -111,6 +111,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + MIDNIGHT_COMMANDER_ICON 'mc' TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '.NET' @@ -214,6 +215,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + MIDNIGHT_COMMANDER_ICON 'mc' TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '.NET' @@ -321,6 +323,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + MIDNIGHT_COMMANDER_ICON 'mc' TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '.NET' @@ -425,6 +428,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '\ue73f' #  RANGER_ICON '\u2B50' # ⭐ + MIDNIGHT_COMMANDER_ICON 'mc' TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ PROXY_ICON '\u2B82' # ⮂ DOTNET_ICON '\uE77F' #  @@ -528,6 +532,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + MIDNIGHT_COMMANDER_ICON 'mc' TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ PROXY_ICON '\u2194' # ↔ DOTNET_ICON '.NET' diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 9be1f1d0..322ef7ca 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3405,6 +3405,15 @@ function instant_prompt_ranger() { _p9k_prompt_segment prompt_ranger $_p9k_color1 yellow RANGER_ICON 1 '$RANGER_LEVEL' '$RANGER_LEVEL' } +function prompt_midnight_commander() { + [[ -n $MC_TMPDIR ]] || return + _p9k_prompt_segment $0 $_p9k_color1 yellow MIDNIGHT_COMMANDER_ICON 0 '' '' +} + +function instant_prompt_midnight_commander() { + _p9k_prompt_segment prompt_midnight_commander $_p9k_color1 yellow MIDNIGHT_COMMANDER_ICON 0 '$MC_TMPDIR' '' +} + function prompt_terraform() { (( $+commands[terraform] )) || return local ws=default