summaryrefslogtreecommitdiff
path: root/.zsh/functions
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2011-05-03 11:58:44 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2011-05-03 15:19:00 +0200
commit9908c246f7855de6951e8564d87301efbac63e8c (patch)
treee4d5069b68c60d4ef7fb32a64c8c8f7b73183f8b /.zsh/functions
parent7339375aae4c25f2b768a5cd6f474baec0539250 (diff)
downloaddotfiles-9908c246f7855de6951e8564d87301efbac63e8c.tar.gz
dotfiles-9908c246f7855de6951e8564d87301efbac63e8c.tar.bz2
dotfiles-9908c246f7855de6951e8564d87301efbac63e8c.zip
Gentoo zsh prompt
Diffstat (limited to '.zsh/functions')
-rw-r--r--.zsh/functions/prompt_gentoo_setup33
1 files changed, 33 insertions, 0 deletions
diff --git a/.zsh/functions/prompt_gentoo_setup b/.zsh/functions/prompt_gentoo_setup
new file mode 100644
index 0000000..0d071e9
--- /dev/null
+++ b/.zsh/functions/prompt_gentoo_setup
@@ -0,0 +1,33 @@
+# 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 () {
+ prompt_gentoo_prompt=${1:-'blue'}
+ prompt_gentoo_user=${2:-'green'}
+ prompt_gentoo_root=${3:-'red'}
+
+ if [ "$USER" = 'root' ]
+ then
+ base_prompt="%B%F{$prompt_gentoo_root}%m%k "
+ else
+ base_prompt="%B%F{$prompt_gentoo_user}%n@%m%k "
+ fi
+ post_prompt="%b%f%k"
+
+ #setopt noxtrace localoptions
+
+ path_prompt="%B%F{$prompt_gentoo_prompt}%1~"
+ PS1="$base_prompt$path_prompt %# $post_prompt"
+ PS2="$base_prompt$path_prompt %_> $post_prompt"
+ PS3="$base_prompt$path_prompt ?# $post_prompt"
+}
+
+prompt_gentoo_setup "$@"