From 523b75e1e463902abcd4b60922dd4b3ca1583a03 Mon Sep 17 00:00:00 2001 From: Alex Reece Date: Thu, 13 Jun 2013 01:28:53 -0400 Subject: [PATCH] add awreece prompt --- modules/prompt/functions/prompt_awreece_setup | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 modules/prompt/functions/prompt_awreece_setup diff --git a/modules/prompt/functions/prompt_awreece_setup b/modules/prompt/functions/prompt_awreece_setup new file mode 100644 index 00000000..2dcb1e54 --- /dev/null +++ b/modules/prompt/functions/prompt_awreece_setup @@ -0,0 +1,168 @@ +# +# A simple theme that displays relevant, contextual information. +# +# Authors: +# Alex Reece +# +# Screenshots: +# http://codearcana.com/posts/2013/11/06/my-zsh-theme.html +# http://codearcana.com/images/zsh_theme.png +# + +function prompt_awreece_help { +cat </dev/null + fi +} + +# Return a zero exit status (true) iff the current shell is controlled via ssh. +function prompt_awreece_is_ssh { + # Actually, sudo etc clear a bunch of environment variables, including + # SSH_CONNECTION, so this doesn't always work. Unfortunately, I don't know + # the best way to make it work. For now, I'll hide it in a function and I can + # update it when I figure out a better way later. + [[ -n $SSH_CONNECTION ]] +} + +function prompt_awreece_preview { + local +h PROMPT='%# ' + local +h RPROMPT='' + # Set a last_run_time to make it interesting. + local +h last_run_time=3.14159 + + prompt_preview_theme 'awreece' "$@" +} + +prompt_awreece_setup "$@"