aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2023-06-11 09:14:06 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2023-06-11 09:14:06 +0300
commit416bdf1ca38207f2cc3d70795a59c781f20e9d05 (patch)
tree6705aab76ef9da779cd81d4ee91a49ee3314d0fe
parente4b8925478d79795713c80dca4680782a33cdc1b (diff)
parent3ecef8c6a5d12d7aaf0335efc3483c4145371337 (diff)
Merge branch 'feat/add-chezmoi-prompt' of https://github.com/Alkindi42/powerlevel10k into Alkindi42-feat/add-chezmoi-prompt
-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-pure.zsh1
-rw-r--r--config/p10k-rainbow.zsh8
-rw-r--r--internal/icons.zsh5
-rw-r--r--internal/p10k.zsh15
8 files changed, 51 insertions, 0 deletions
diff --git a/README.md b/README.md
index 30f9927c..1de5aac5 100644
--- a/README.md
+++ b/README.md
@@ -314,6 +314,7 @@ enable as many segments as you like. It won't slow down your prompt or Zsh start
| `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name |
| `background_jobs` | presence of background jobs |
| `battery` | internal battery state and charge level (yep, batteries *literally* included) |
+| `chezmoi` | [chezmoi](https://github.com/twpayne/chezmoi) shell |
| `command_execution_time` | duration (wall time) of the last command |
| `context` | user@hostname |
| `cpu_arch` | CPU architecture |
diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh
index c67d63a0..8a52ae1e 100644
--- a/config/p10k-classic.zsh
+++ b/config/p10k-classic.zsh
@@ -42,6 +42,7 @@
status # exit code of the last command
command_execution_time # duration of the last command
background_jobs # presence of background jobs
+ chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi)
direnv # direnv status (https://direnv.net/)
asdf # asdf version manager (https://github.com/asdf-vm/asdf)
virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
@@ -739,6 +740,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]##################
+ # chezmoi shell color.
+ typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=72
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_CHEZMOI_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 c63bc6c7..b4ee4e8a 100644
--- a/config/p10k-lean-8colors.zsh
+++ b/config/p10k-lean-8colors.zsh
@@ -42,6 +42,7 @@
status # exit code of the last command
command_execution_time # duration of the last command
background_jobs # presence of background jobs
+ chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi)
direnv # direnv status (https://direnv.net/)
asdf # asdf version manager (https://github.com/asdf-vm/asdf)
virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
@@ -734,6 +735,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]##################
+ # chezmoi shell color.
+ typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=72
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_CHEZMOI_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 154dc0ec..1c8520bd 100644
--- a/config/p10k-lean.zsh
+++ b/config/p10k-lean.zsh
@@ -42,6 +42,7 @@
status # exit code of the last command
command_execution_time # duration of the last command
background_jobs # presence of background jobs
+ chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi)
direnv # direnv status (https://direnv.net/)
asdf # asdf version manager (https://github.com/asdf-vm/asdf)
virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
@@ -730,6 +731,12 @@
# Custom icon.
# typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]##################
+ # chezmoi shell color.
+ typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=72
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_CHEZMOI_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-pure.zsh b/config/p10k-pure.zsh
index 97c1a207..4682fc76 100644
--- a/config/p10k-pure.zsh
+++ b/config/p10k-pure.zsh
@@ -51,6 +51,7 @@
newline # \n
virtualenv # python virtual environment
prompt_char # prompt symbol
+ chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi)
)
# Right prompt segments.
diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh
index 7f35949c..f8290dc2 100644
--- a/config/p10k-rainbow.zsh
+++ b/config/p10k-rainbow.zsh
@@ -45,6 +45,7 @@
direnv # direnv status (https://direnv.net/)
asdf # asdf version manager (https://github.com/asdf-vm/asdf)
virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
+ chezmoi # chezmoi prompt (https://github.com/twpayne/chezmoi)
anaconda # conda environment (https://conda.io/)
pyenv # python environment (https://github.com/pyenv/pyenv)
goenv # go environment (https://github.com/syndbg/goenv)
@@ -761,6 +762,13 @@
# Custom icon.
# typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'
+ ##################[ chezmoi: chezmoi shell (https://github.com/twpayne/chezmoi) ]##################
+ # chezmoi shell color.
+ typeset -g POWERLEVEL9K_CHEZMOI_FOREGROUND=0
+ typeset -g POWERLEVEL9K_CHEZMOI_BACKGROUND=6
+ # Custom icon.
+ # typeset -g POWERLEVEL9K_CHEZMOI_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 6b3a9b09..b5f1d0ec 100644
--- a/internal/icons.zsh
+++ b/internal/icons.zsh
@@ -107,6 +107,7 @@ function _p9k_init_icons() {
VCS_SVN_ICON 'svn'$q
RUST_ICON 'R'
PYTHON_ICON '\uE63C'$s #  (doesn't always work)
+ CHEZMOI_ICON '\uf015' # 
SWIFT_ICON 'Swift'
GO_ICON 'Go'
GOLANG_ICON 'Go'
@@ -243,6 +244,7 @@ function _p9k_init_icons() {
VCS_SVN_ICON 'svn'$q
RUST_ICON '\uE6A8' # 
PYTHON_ICON '\uE63C'$s # 
+ CHEZMOI_ICON '\uf015' # 
SWIFT_ICON 'Swift'
GO_ICON 'Go'
GOLANG_ICON 'Go'
@@ -384,6 +386,7 @@ function _p9k_init_icons() {
VCS_SVN_ICON 'svn'$q
RUST_ICON '\uE6A8' # 
PYTHON_ICON '\U1F40D' # 🐍
+ CHEZMOI_ICON "${CODEPOINT_OF_AWESOME_HOME:+\\u$CODEPOINT_OF_AWESOME_HOME}"
SWIFT_ICON '\uE655'$s # 
PUBLIC_IP_ICON "${CODEPOINT_OF_AWESOME_GLOBE:+\\u$CODEPOINT_OF_AWESOME_GLOBE$s}"
LOCK_ICON "${CODEPOINT_OF_AWESOME_LOCK:+\\u$CODEPOINT_OF_AWESOME_LOCK}"
@@ -519,6 +522,7 @@ function _p9k_init_icons() {
VCS_SVN_ICON '\uE72D'$q # 
RUST_ICON '\uE7A8'$q # 
PYTHON_ICON '\UE73C ' # 
+ CHEZMOI_ICON '\Uf015' # 
SWIFT_ICON '\uE755' # 
GO_ICON '\uE626' # 
GOLANG_ICON '\uE626' # 
@@ -656,6 +660,7 @@ function _p9k_init_icons() {
VCS_SVN_ICON '\uE72D'$q # 
RUST_ICON '\uE7A8'$q # 
PYTHON_ICON '\UE73C ' # 
+ CHEZMOI_ICON '\Uf015' # 
SWIFT_ICON '\uE755' # 
GO_ICON '\uE626' # 
GOLANG_ICON '\uE626' # 
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index bfa267d6..b41c6ebb 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4261,6 +4261,21 @@ instant_prompt_vi_mode() {
}
################################################################
+# Segment to display chezmoi information.
+# More information: https://www.chezmoi.io/
+prompt_chezmoi() {
+ _p9k_prompt_segment "$0" "black" "white" 'CHEZMOI_ICON' 0 '' "chezmoi"
+}
+
+_p9k_prompt_chezmoi_init() {
+ typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$CHEZMOI'
+}
+
+function instant_prompt_chezmoi() {
+ _p9k_prompt_segment prompt_chezmoi "black" "white" CHEZMOI_ICON 0 '' 'chezmoi'
+}
+
+################################################################
# Virtualenv: current working virtualenv
# More information on virtualenv (Python):
# https://virtualenv.pypa.io/en/latest/