summaryrefslogtreecommitdiff
path: root/machines/kj-laptop01/zsh-config.zsh
diff options
context:
space:
mode:
authorKj Tsanaktsidis <kjtsanaktsidis@groq.com>2026-01-09 11:58:31 +1100
committerKj Tsanaktsidis <kjtsanaktsidis@groq.com>2026-01-09 11:58:31 +1100
commit98e94297af73c583c9636c99772b2c1c34f98743 (patch)
tree1ac244e55b6d544d556b2327308d07708350e824 /machines/kj-laptop01/zsh-config.zsh
parentf5686b8e377ce3ecbf617783b4f2398423cb19fd (diff)
some refactor
Diffstat (limited to 'machines/kj-laptop01/zsh-config.zsh')
-rw-r--r--machines/kj-laptop01/zsh-config.zsh45
1 files changed, 45 insertions, 0 deletions
diff --git a/machines/kj-laptop01/zsh-config.zsh b/machines/kj-laptop01/zsh-config.zsh
new file mode 100644
index 0000000..8ef8747
--- /dev/null
+++ b/machines/kj-laptop01/zsh-config.zsh
@@ -0,0 +1,45 @@
+# Initialize completion system
+autoload -Uz compinit
+compinit
+
+# Initialize prompt system
+autoload -Uz promptinit
+promptinit
+
+# Set options
+setopt extendedglob nomatch notify
+
+# Define gentoo prompt theme
+prompt_gentoo_help () {
+ cat <<'EOF'
+This prompt is color-scheme-able. You can invoke it thus:
+
+ prompt gentoo [<promptcolor> [<usercolor> [<rootcolor>]]]
+
+EOF
+}
+
+prompt_gentoo_setup () {
+ local prompt_gentoo_prompt=${1:-'blue'}
+ local prompt_gentoo_user=${2:-'green'}
+ local prompt_gentoo_root=${3:-'red'}
+
+ if [ "$USER" = 'root' ]
+ then
+ local base_prompt="%B%F{$prompt_gentoo_root}%m%k "
+ else
+ local base_prompt="%B%F{$prompt_gentoo_user}%n@%m%k "
+ fi
+ local post_prompt="%b%f%k"
+
+ local path_prompt="%B%F{$prompt_gentoo_prompt}%1~"
+ typeset -g PS1="$base_prompt$path_prompt %# $post_prompt"
+ typeset -g PS2="$base_prompt$path_prompt %_> $post_prompt"
+ typeset -g PS3="$base_prompt$path_prompt ?# $post_prompt"
+}
+
+# Register the prompt with promptinit
+prompt_themes+=( gentoo )
+
+# Use the gentoo prompt
+prompt gentoo