summaryrefslogtreecommitdiff
path: root/.zsh/functions/prompt_necoro_setup
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.zsh/functions/prompt_necoro_setup33
1 files changed, 33 insertions, 0 deletions
diff --git a/.zsh/functions/prompt_necoro_setup b/.zsh/functions/prompt_necoro_setup
new file mode 100644
index 0000000..16d3654
--- /dev/null
+++ b/.zsh/functions/prompt_necoro_setup
@@ -0,0 +1,33 @@
+# gentoo prompt theme
+
+prompt_necoro_help () {
+ cat <<'EOF'
+This prompt is color-scheme-able. You can invoke it thus:
+
+ prompt necoro [<promptcolor> [<usercolor> [<rootcolor>]]]
+
+EOF
+}
+
+prompt_necoro_setup () {
+ prompt_necoro_prompt=${1:-'blue'}
+ prompt_necoro_user=${2:-'green'}
+ prompt_necoro_root=${3:-'red'}
+
+ if [ "$USER" = 'root' ]
+ then
+ base_prompt="%B%F{$prompt_necoro_root}%m%k "
+ else
+ base_prompt="%B%F{$prompt_necoro_user}%n@%m%k "
+ fi
+ post_prompt="%b%f%k"
+
+ #setopt noxtrace localoptions
+
+ path_prompt="%B%F{$prompt_necoro_prompt}%1~"
+ PS1="$base_prompt$path_prompt %# $post_prompt"
+ PS2="$base_prompt$path_prompt %_> $post_prompt"
+ PS3="$base_prompt$path_prompt ?# $post_prompt"
+}
+
+prompt_necoro_setup "$@"