summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Baz <github@maximbaz.com>2021-05-15 14:37:58 +0300
committerGitHub <noreply@github.com>2021-05-15 14:37:58 +0300
commit9c034101fe3cec1e2edb8e07c32a3e6dba9afaee (patch)
tree7bfac7f15a953efc1ed021a293f33975e7e1b954
parentf924646194e95c9ef0423d0e6c10cf41cc7bf6b1 (diff)
Add xplr segment (#1396)
-rw-r--r--README.md1
-rw-r--r--config/p10k-classic.zsh7
-rw-r--r--config/p10k-lean-8colors.zsh7
-rw-r--r--config/p10k-lean.zsh7
-rw-r--r--config/p10k-rainbow.zsh8
-rw-r--r--internal/icons.zsh6
-rw-r--r--internal/p10k.zsh14
7 files changed, 50 insertions, 0 deletions
diff --git a/README.md b/README.md
index 55a0040e..8b635471 100644
--- a/README.md
+++ b/README.md
@@ -307,6 +307,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start
| `nordvpn` | [nordvpn](https://nordvpn.com/) connection status |
| `ranger` | [ranger](https://github.com/ranger/ranger) shell |
| `nnn` | [nnn](https://github.com/jarun/nnn) shell |
+| `xplr` | [xplr](https://github.com/sayanarijit/xplr) shell |
| `vim_shell` | [vim](https://www.vim.org/) shell (`:sh`) |
| `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell |
| `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator |
diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh
index b6f81eb6..a2fdb916 100644
--- a/config/p10k-classic.zsh
+++ b/config/p10k-classic.zsh
@@ -79,6 +79,7 @@
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
nnn # nnn shell (https://github.com/jarun/nnn)
+ xplr # xplr shell (https://github.com/sayanarijit/xplr)
vim_shell # vim shell indicator (:sh)
midnight_commander # midnight commander shell (https://midnight-commander.org/)
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
@@ -713,6 +714,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]##################
+ # xplr shell color.
+ typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
+
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
# Vim shell indicator color.
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34
diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh
index abc646b4..5d944328 100644
--- a/config/p10k-lean-8colors.zsh
+++ b/config/p10k-lean-8colors.zsh
@@ -79,6 +79,7 @@
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
nnn # nnn shell (https://github.com/jarun/nnn)
+ xplr # xplr shell (https://github.com/sayanarijit/xplr)
vim_shell # vim shell indicator (:sh)
midnight_commander # midnight commander shell (https://midnight-commander.org/)
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
@@ -711,6 +712,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]##################
+ # xplr shell color.
+ typeset -g POWERLEVEL9K_XPLR_FOREGROUND=3
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
+
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
# Vim shell indicator color.
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=3
diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh
index 6eb56418..fab84a62 100644
--- a/config/p10k-lean.zsh
+++ b/config/p10k-lean.zsh
@@ -79,6 +79,7 @@
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
nnn # nnn shell (https://github.com/jarun/nnn)
+ xplr # xplr shell (https://github.com/sayanarijit/xplr)
vim_shell # vim shell indicator (:sh)
midnight_commander # midnight commander shell (https://midnight-commander.org/)
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
@@ -707,6 +708,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]##################
+ # xplr shell color.
+ typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
+
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
# Vim shell indicator color.
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34
diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh
index be6748a2..48fdaabb 100644
--- a/config/p10k-rainbow.zsh
+++ b/config/p10k-rainbow.zsh
@@ -79,6 +79,7 @@
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
nnn # nnn shell (https://github.com/jarun/nnn)
+ xplr # xplr shell (https://github.com/sayanarijit/xplr)
vim_shell # vim shell indicator (:sh)
midnight_commander # midnight commander shell (https://midnight-commander.org/)
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
@@ -733,6 +734,13 @@
# Custom icon.
# typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]##################
+ # xplr shell color.
+ typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0
+ typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
+
###########################[ vim_shell: vim shell indicator (:sh) ]###########################
# Vim shell indicator color.
typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0
diff --git a/internal/icons.zsh b/internal/icons.zsh
index 532ab0a6..a10be26d 100644
--- a/internal/icons.zsh
+++ b/internal/icons.zsh
@@ -132,6 +132,7 @@ function _p9k_init_icons() {
LUA_ICON 'lua'
PERL_ICON 'perl'
NNN_ICON 'nnn'
+ XPLR_ICON 'xplr'
TIMEWARRIOR_ICON 'tw'
TASKWARRIOR_ICON 'task'
NIX_SHELL_ICON 'nix'
@@ -260,6 +261,7 @@ function _p9k_init_icons() {
LUA_ICON 'lua'
PERL_ICON 'perl'
NNN_ICON 'nnn'
+ XPLR_ICON 'xplr'
TIMEWARRIOR_ICON 'tw'
TASKWARRIOR_ICON 'task'
NIX_SHELL_ICON 'nix'
@@ -391,6 +393,7 @@ function _p9k_init_icons() {
LUA_ICON 'lua'
PERL_ICON 'perl'
NNN_ICON 'nnn'
+ XPLR_ICON 'xplr'
TIMEWARRIOR_ICON 'tw'
TASKWARRIOR_ICON 'task'
NIX_SHELL_ICON 'nix'
@@ -520,6 +523,7 @@ function _p9k_init_icons() {
LUA_ICON '\uE620' # 
PERL_ICON '\uE769' # 
NNN_ICON 'nnn'
+ XPLR_ICON 'xplr'
TIMEWARRIOR_ICON '\uF49B' # 
TASKWARRIOR_ICON '\uF4A0 ' # 
NIX_SHELL_ICON '\uF313 ' # 
@@ -646,6 +650,7 @@ function _p9k_init_icons() {
LUA_ICON 'lua'
PERL_ICON 'perl'
NNN_ICON 'nnn'
+ XPLR_ICON 'xplr'
TIMEWARRIOR_ICON 'tw'
TASKWARRIOR_ICON 'task'
NIX_SHELL_ICON 'nix'
@@ -774,6 +779,7 @@ function _p9k_init_icons() {
LUA_ICON 'lua'
PERL_ICON 'perl'
NNN_ICON 'nnn'
+ XPLR_ICON 'xplr'
TIMEWARRIOR_ICON 'tw'
TASKWARRIOR_ICON 'task'
NIX_SHELL_ICON 'nix'
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index d840e0d8..d96daa7d 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4753,6 +4753,20 @@ function instant_prompt_nnn() {
_p9k_prompt_segment prompt_nnn 6 $_p9k_color1 NNN_ICON 1 '${NNNLVL:#0}' '$NNNLVL'
}
+function prompt_xplr() {
+ local -i len=$#_p9k__prompt _p9k__has_upglob
+ _p9k_prompt_segment $0 6 $_p9k_color1 XPLR_ICON 0 '' ''
+ (( _p9k__has_upglob )) || typeset -g "_p9k__segment_val_${_p9k__prompt_side}[_p9k__segment_index]"=$_p9k__prompt[len+1,-1]
+}
+
+_p9k_prompt_xplr_init() {
+ typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$XPLR_PID'
+}
+
+function instant_prompt_xplr() {
+ _p9k_prompt_segment prompt_xplr 6 $_p9k_color1 XPLR_ICON 0 '$XPLR_PID' ''
+}
+
function prompt_vim_shell() {
local -i len=$#_p9k__prompt _p9k__has_upglob
_p9k_prompt_segment $0 green $_p9k_color1 VIM_ICON 0 '' ''