aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-10-08 17:13:40 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-10-08 17:13:40 +0300
commit02290d1eb9fa4537144b1d81dfb279175543468c (patch)
treee9853ca95520b66677d94ef02d8b86fd0e9701c2 /internal/p10k.zsh
parent5ee784787fe3c1855ee6f365cbf045712843989e (diff)
parent59e90bd8b0bee6b00bc9153f13336f6cafeae08a (diff)
Merge branch 'master' of github.com:brent-moffit/powerlevel10k into brent-moffit-master
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 08aacf79..f9e38f84 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -5644,6 +5644,23 @@ _p9k_prompt_haskell_stack_init() {
typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[stack]'
}
+################################################################
+# CPU Architecture
+prompt_arch() {
+ if ! _p9k_cache_ephemeral_get $0 ; then
+ _p9k_cache_ephemeral_set $(arch)
+ fi
+ [[ $_p9k__cache_val[1] == $POWERLEVEL9K_ARCH_DEFAULT ]] && return
+ _p9k_prompt_segment "$0" "$_p9k_color1" "orange1" 'ARCH_ICON' 0 '' "$_p9k__cache_val[1]"
+}
+
+instant_prompt_arch() { prompt_arch; }
+
+_p9k_prompt_arch_init() {
+ echo 'arch init' >> ~/p9k_debug.txt
+ typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='$commands[arch]'
+}
+
# Use two preexec hooks to survive https://github.com/MichaelAquilina/zsh-you-should-use with
# YSU_HARDCORE=1. See https://github.com/romkatv/powerlevel10k/issues/427.
_p9k_preexec1() {