From f049be947cdead20275b6b81db6cda683055348d Mon Sep 17 00:00:00 2001 From: Faddeev-Popov <205490674+Faddeev-Popov@users.noreply.github.com> Date: Tue, 10 Jun 2025 23:37:32 -0400 Subject: [PATCH 1/5] add icon for vifm level --- internal/icons.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/icons.zsh b/internal/icons.zsh index 1d1cafbb..18193238 100644 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -141,6 +141,7 @@ function _p9k_init_icons() { LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ YAZI_ICON '\u2B50' # ⭐ + VIFM_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' TERRAFORM_ICON 'tf' @@ -296,6 +297,7 @@ function _p9k_init_icons() { LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ YAZI_ICON '\u2B50' # ⭐ + VIFM_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' TERRAFORM_ICON 'tf' @@ -454,6 +456,7 @@ function _p9k_init_icons() { LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ YAZI_ICON '\u2B50' # ⭐ + VIFM_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' TERRAFORM_ICON 'tf' @@ -615,6 +618,7 @@ function _p9k_init_icons() { LARAVEL_ICON '\ue73f'$q #  RANGER_ICON '\uF00b ' #  YAZI_ICON '\uF00b ' #  + VIFM_ICON '\uF00b ' #  MIDNIGHT_COMMANDER_ICON 'mc' # mc VIM_ICON '\uE62B' #  TERRAFORM_ICON '\uF1BB ' #  @@ -771,6 +775,7 @@ function _p9k_init_icons() { LARAVEL_ICON '\ue73f'$q #  RANGER_ICON '\uF00b ' #  YAZI_ICON '\uF00b ' #  + VIFM_ICON 'vifm' # vifm MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON '\uE62B' #  TERRAFORM_ICON '\uF1BB ' #  @@ -924,6 +929,7 @@ function _p9k_init_icons() { LARAVEL_ICON '' RANGER_ICON 'ranger' YAZI_ICON 'yazi' + VIFM_ICON 'vifm' MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' TERRAFORM_ICON 'tf' @@ -1079,6 +1085,7 @@ function _p9k_init_icons() { LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ YAZI_ICON '\u2B50' # ⭐ + VIFM_ICON '\u2B50' # ⭐ MIDNIGHT_COMMANDER_ICON 'mc' VIM_ICON 'vim' TERRAFORM_ICON 'tf' From 9b3fc772e42848d23a865567b248175af21b12ee Mon Sep 17 00:00:00 2001 From: Faddeev-Popov <205490674+Faddeev-Popov@users.noreply.github.com> Date: Tue, 10 Jun 2025 23:49:30 -0400 Subject: [PATCH 2/5] add prompt segment for vifm levels --- internal/p10k.zsh | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f73dd208..f673d1d4 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4971,6 +4971,18 @@ function instant_prompt_yazi() { _p9k_prompt_segment prompt_yazi $_p9k_color1 yellow YAZI_ICON 1 '$YAZI_LEVEL' '$YAZI_LEVEL' } +function prompt_vifm() { + _p9k_prompt_segment $0 $_p9k_color1 yellow VIFM_ICON 0 '' $VIFM_LEVEL +} + +_p9k_prompt_vifm_init() { + typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$VIFM_LEVEL' +} + +function instant_prompt_vifm() { + _p9k_prompt_segment prompt_vifm $_p9k_color1 yellow VIFM_ICON 1 '$VIFM_LEVEL' '$VIFM_LEVEL' +} + function prompt_midnight_commander() { local -i len=$#_p9k__prompt _p9k__has_upglob _p9k_prompt_segment $0 $_p9k_color1 yellow MIDNIGHT_COMMANDER_ICON 0 '' '' @@ -5372,17 +5384,17 @@ _p9k_prompt_wifi_async() { # Output example (https://github.com/romkatv/powerlevel10k/pull/973#issuecomment-680251804): # # Connected to 74:83:c2:be:76:da (on wlp3s0) - # SSID: DailyGrindGuest1 - # freq: 5745 - # RX: 35192066 bytes (27041 packets) - # TX: 4090471 bytes (24287 packets) - # signal: -52 dBm - # rx bitrate: 243.0 MBit/s VHT-MCS 6 40MHz VHT-NSS 2 - # tx bitrate: 240.0 MBit/s VHT-MCS 5 40MHz short GI VHT-NSS 2 + # SSID: DailyGrindGuest1 + # freq: 5745 + # RX: 35192066 bytes (27041 packets) + # TX: 4090471 bytes (24287 packets) + # signal: -52 dBm + # rx bitrate: 243.0 MBit/s VHT-MCS 6 40MHz VHT-NSS 2 + # tx bitrate: 240.0 MBit/s VHT-MCS 5 40MHz short GI VHT-NSS 2 # - # bss flags: short-slot-time - # dtim period: 1 - # beacon int: 100 + # bss flags: short-slot-time + # dtim period: 1 + # beacon int: 100 lines=(${(f)"$(command iw dev $iface link)"}) || return 0 local -a match mbegin mend for line in $lines; do From ff6f434aa90161989ed7f97b16fbb24a7419e3d6 Mon Sep 17 00:00:00 2001 From: Faddeev-Popov <205490674+Faddeev-Popov@users.noreply.github.com> Date: Wed, 11 Jun 2025 00:03:40 -0400 Subject: [PATCH 3/5] add visual expansion to wizard for vifm --- internal/p10k.zsh | 20 ++++++++++---------- internal/wizard.zsh | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index f673d1d4..878d8179 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -5384,17 +5384,17 @@ _p9k_prompt_wifi_async() { # Output example (https://github.com/romkatv/powerlevel10k/pull/973#issuecomment-680251804): # # Connected to 74:83:c2:be:76:da (on wlp3s0) - # SSID: DailyGrindGuest1 - # freq: 5745 - # RX: 35192066 bytes (27041 packets) - # TX: 4090471 bytes (24287 packets) - # signal: -52 dBm - # rx bitrate: 243.0 MBit/s VHT-MCS 6 40MHz VHT-NSS 2 - # tx bitrate: 240.0 MBit/s VHT-MCS 5 40MHz short GI VHT-NSS 2 + # SSID: DailyGrindGuest1 + # freq: 5745 + # RX: 35192066 bytes (27041 packets) + # TX: 4090471 bytes (24287 packets) + # signal: -52 dBm + # rx bitrate: 243.0 MBit/s VHT-MCS 6 40MHz VHT-NSS 2 + # tx bitrate: 240.0 MBit/s VHT-MCS 5 40MHz short GI VHT-NSS 2 # - # bss flags: short-slot-time - # dtim period: 1 - # beacon int: 100 + # bss flags: short-slot-time + # dtim period: 1 + # beacon int: 100 lines=(${(f)"$(command iw dev $iface link)"}) || return 0 local -a match mbegin mend for line in $lines; do diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 5ae58002..5bdaa268 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -1750,6 +1750,8 @@ function generate_config() { sub RANGER_VISUAL_IDENTIFIER_EXPANSION "'▲'" uncomment 'typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION' sub YAZI_VISUAL_IDENTIFIER_EXPANSION "'▲'" + uncomment 'typeset -g POWERLEVEL9K_VIFM_VISUAL_IDENTIFIER_EXPANSION' + sub VIFM_VISUAL_IDENTIFIER_EXPANSION "'▲'" uncomment 'typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION' sub KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION "'○'" uncomment 'typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION' From 29fe575b3c38c7f92ea52685ef8acdc73a6ad50a Mon Sep 17 00:00:00 2001 From: Faddeev-Popov <205490674+Faddeev-Popov@users.noreply.github.com> Date: Wed, 11 Jun 2025 01:11:48 -0400 Subject: [PATCH 4/5] add themes support for vifm --- config/p10k-classic.zsh | 7 +++++++ config/p10k-lean-8colors.zsh | 7 +++++++ config/p10k-lean.zsh | 7 +++++++ config/p10k-rainbow.zsh | 8 ++++++++ 4 files changed, 29 insertions(+) diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index 623b9308..d5616e7c 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -82,6 +82,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) yazi # yazi shell (https://github.com/sxyazi/yazi) + vifm # vifm shell (https://github.com/vifm/vifm) nnn # nnn shell (https://github.com/jarun/nnn) lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) @@ -737,6 +738,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' + ####################[ vifm: vifm shell (https://github.com/vifm/vifm) ]##################### + # Vifm shell color. + typeset -g POWERLEVEL9K_VIFM_FOREGROUND=178 + # Custom icon. + # typeset -g POWERLEVEL9K_VIFM_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. typeset -g POWERLEVEL9K_NNN_FOREGROUND=72 diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh index 3f72ff4b..00bb8a17 100644 --- a/config/p10k-lean-8colors.zsh +++ b/config/p10k-lean-8colors.zsh @@ -82,6 +82,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) yazi # yazi shell (https://github.com/sxyazi/yazi) + vifm # vifm shell (https://github.com/vifm/vifm) nnn # nnn shell (https://github.com/jarun/nnn) lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) @@ -728,6 +729,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' + ####################[ vifm: vifm shell (https://github.com/vifm/vifm) ]##################### + # Vifm shell color. + typeset -g POWERLEVEL9K_VIFM_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_VIFM_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. typeset -g POWERLEVEL9K_NNN_FOREGROUND=3 diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index cef70fd8..281c9229 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -82,6 +82,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) yazi # yazi shell (https://github.com/sxyazi/yazi) + vifm # vifm shell (https://github.com/vifm/vifm) nnn # nnn shell (https://github.com/jarun/nnn) lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) @@ -728,6 +729,12 @@ # Custom icon. # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' + ####################[ vifm: vifm shell (https://github.com/vifm/vifm) ]##################### + # Vifm shell color. + typeset -g POWERLEVEL9K_VIFM_FOREGROUND=178 + # Custom icon. + # typeset -g POWERLEVEL9K_VIFM_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. typeset -g POWERLEVEL9K_NNN_FOREGROUND=72 diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh index ed74b7fa..0e2d92ad 100644 --- a/config/p10k-rainbow.zsh +++ b/config/p10k-rainbow.zsh @@ -82,6 +82,7 @@ nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) yazi # yazi shell (https://github.com/sxyazi/yazi) + vifm # vifm shell (https://github.com/vifm/vifm) nnn # nnn shell (https://github.com/jarun/nnn) lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) @@ -757,6 +758,13 @@ # Custom icon. # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' + ####################[ vifm: vifm shell (https://github.com/vifm/vifm) ]##################### + # Vifm shell color. + typeset -g POWERLEVEL9K_VIFM_FOREGROUND=3 + typeset -g POWERLEVEL9K_VIFM_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_VIFM_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 From 8cc3298bac5fe52f19a93a0dfd734878e1f810a7 Mon Sep 17 00:00:00 2001 From: Faddeev-Popov <205490674+Faddeev-Popov@users.noreply.github.com> Date: Wed, 11 Jun 2025 01:13:34 -0400 Subject: [PATCH 5/5] update readme with vifm information --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 22c68d62..5e4f1bc8 100644 --- a/README.md +++ b/README.md @@ -364,6 +364,7 @@ You can enable as many segments as you like. It won't slow down your prompt or Z | `ram` | free RAM | | `ranger` | [ranger](https://github.com/ranger/ranger) shell | | `yazi` | [yazi](https://github.com/sxyazi/yazi) shell | +| `vifm` | [vifm](https://github.com/vifm/vifm) shell | | `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) | | `rust_version` | [rustc](https://www.rust-lang.org) version | | `rvm` | ruby environment from [rvm](https://rvm.io) |