From 214b55d9a70b910cb82555b956fec2d84e119280 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Mon, 29 Jun 2015 13:50:59 +0200 Subject: renaming to adam3, and adding a lincence --- LICENCE | 33 +++++++++++++++++++++++++++++++++ prompt_adam1_setup | 54 ------------------------------------------------------ prompt_adam3_setup | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 54 deletions(-) create mode 100644 LICENCE delete mode 100644 prompt_adam1_setup create mode 100644 prompt_adam3_setup diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..78ce01d --- /dev/null +++ b/LICENCE @@ -0,0 +1,33 @@ +The adam3 prompt is based upon adam1, which is a prompt that is distributed +with zsh. + +The original code uses the licence below. Any and all changes follows the same +licence. + +-- + +The Z Shell is copyright (c) 1992-2009 Paul Falstad, Richard Coleman, +Zoltán Hidvégi, Andrew Main, Peter Stephenson, Sven Wischnowsky, and +others. All rights reserved. Individual authors, whether or not +specifically named, retain copyright in all changes; in what follows, they +are referred to as `the Zsh Development Group'. This is for convenience +only and this body has no legal status. The Z shell is distributed under +the following licence; any provisions made in individual files take +precedence. + +Permission is hereby granted, without written agreement and without +licence or royalty fees, to use, copy, modify, and distribute this +software and to distribute modified versions of this software for any +purpose, provided that the above copyright notice and the following +two paragraphs appear in all copies of this software. + +In no event shall the Zsh Development Group be liable to any party for +direct, indirect, special, incidental, or consequential damages arising out +of the use of this software and its documentation, even if the Zsh +Development Group have been advised of the possibility of such damage. + +The Zsh Development Group specifically disclaim any warranties, including, +but not limited to, the implied warranties of merchantability and fitness +for a particular purpose. The software provided hereunder is on an "as is" +basis, and the Zsh Development Group have no obligation to provide +maintenance, support, updates, enhancements, or modifications. diff --git a/prompt_adam1_setup b/prompt_adam1_setup deleted file mode 100644 index aca0e59..0000000 --- a/prompt_adam1_setup +++ /dev/null @@ -1,54 +0,0 @@ -# adam1 prompt theme - -prompt_adam1_help () { - cat <<'EOF' -This prompt is color-scheme-able. You can invoke it thus: - - prompt adam1 [ [ []]] - -where the colors are for the user@host background, current working -directory, and current working directory if the prompt is split over -two lines respectively. The default colors are blue, cyan and green. -This theme works best with a dark background. - -Recommended fonts for this theme: nexus or vga or similar. If you -don't have any of these, then specify the `plain' option to use 7-bit -replacements for the 8-bit characters. -EOF -} - -prompt_adam1_setup () { - prompt_adam1_color1=${1:-'blue'} - prompt_adam1_color2=${2:-'cyan'} - prompt_adam1_color3=${3:-'green'} - - base_prompt="%K{$prompt_adam1_color1}%n@%m%k " - post_prompt="%b%f%k" - - setopt localoptions extendedglob - base_prompt_no_color="${base_prompt//(%K{[^\\\}]#\}|%k)/}" - post_prompt_no_color="${post_prompt//(%K{[^\\\}]#\}|%k)/}" - - add-zsh-hook precmd prompt_adam1_precmd -} - -prompt_adam1_precmd () { - setopt noxtrace localoptions - local base_prompt_expanded_no_color base_prompt_etc - local prompt_length space_left - - base_prompt_expanded_no_color=$(print -P "$base_prompt_no_color") - base_prompt_etc=$(print -P "$base_prompt%(4~|...|)%3~") - prompt_length=${#base_prompt_etc} - if [[ $prompt_length -lt 40 ]]; then - path_prompt="%B%F{$prompt_adam1_color2}%(4~|...|)%3~%F{white}" - else - space_left=$(( $COLUMNS - $#base_prompt_expanded_no_color - 2 )) - path_prompt="%B%F{$prompt_adam1_color3}%${space_left}<...<%~$prompt_newline%F{white}" - fi - PS1="$base_prompt$path_prompt %# $post_prompt" - PS2="$base_prompt$path_prompt %_> $post_prompt" - PS3="$base_prompt$path_prompt ?# $post_prompt" -} - -prompt_adam1_setup "$@" diff --git a/prompt_adam3_setup b/prompt_adam3_setup new file mode 100644 index 0000000..3fafb51 --- /dev/null +++ b/prompt_adam3_setup @@ -0,0 +1,54 @@ +# adam3 prompt theme + +prompt_adam3_help () { + cat <<'EOF' +This prompt is color-scheme-able. You can invoke it thus: + + prompt adam3 [ [ []]] + +where the colors are for the user@host background, current working +directory, and current working directory if the prompt is split over +two lines respectively. The default colors are blue, cyan and green. +This theme works best with a dark background. + +Recommended fonts for this theme: nexus or vga or similar. If you +don't have any of these, then specify the `plain' option to use 7-bit +replacements for the 8-bit characters. +EOF +} + +prompt_adam3_setup () { + prompt_adam3_color1=${1:-'blue'} + prompt_adam3_color2=${2:-'cyan'} + prompt_adam3_color3=${3:-'green'} + + base_prompt="%K{$prompt_adam3_color1}%n@%m%k " + post_prompt="%b%f%k" + + setopt localoptions extendedglob + base_prompt_no_color="${base_prompt//(%K{[^\\\}]#\}|%k)/}" + post_prompt_no_color="${post_prompt//(%K{[^\\\}]#\}|%k)/}" + + add-zsh-hook precmd prompt_adam3_precmd +} + +prompt_adam3_precmd () { + setopt noxtrace localoptions + local base_prompt_expanded_no_color base_prompt_etc + local prompt_length space_left + + base_prompt_expanded_no_color=$(print -P "$base_prompt_no_color") + base_prompt_etc=$(print -P "$base_prompt%(4~|...|)%3~") + prompt_length=${#base_prompt_etc} + if [[ $prompt_length -lt 40 ]]; then + path_prompt="%B%F{$prompt_adam3_color2}%(4~|...|)%3~%F{white}" + else + space_left=$(( $COLUMNS - $#base_prompt_expanded_no_color - 2 )) + path_prompt="%B%F{$prompt_adam3_color3}%${space_left}<...<%~$prompt_newline%F{white}" + fi + PS1="$base_prompt$path_prompt %# $post_prompt" + PS2="$base_prompt$path_prompt %_> $post_prompt" + PS3="$base_prompt$path_prompt ?# $post_prompt" +} + +prompt_adam3_setup "$@" -- cgit v1.2.3