aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorbrent-moffit <72231013+brent-moffit@users.noreply.github.com>2022-02-03 04:47:46 +0300
committerbrent-moffit <72231013+brent-moffit@users.noreply.github.com>2022-02-03 04:47:46 +0300
commitc5203a3da2a8814992c91b20f8246b19ea88401c (patch)
tree9eadfe6e85977546d9e673d22600b5011c3a34fa /internal/p10k.zsh
parent8a676a9157d2b0e00e88d06456ac7317f11c0317 (diff)
Add `arch` prompt for displaying CPU architecture
Adds the `arch` prompt to `p10k.zsh`, `ARCH_ICON` to `icons.zsh`, and commented entries in the default configs
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index e797a874..26e43eec 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -5625,6 +5625,21 @@ _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" "orange1" "black" 'ARCH_ICON' 0 '' "$_p9k__cache_val[1]"
+}
+
+_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() {