From c2d42f5a90f12ca925702ed4e8fc5563baf8397c Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Tue, 5 Mar 2013 22:50:27 +0100 Subject: [PATCH 1/2] added michelebologna theme --- themes/michelebologna.zsh-theme | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 themes/michelebologna.zsh-theme diff --git a/themes/michelebologna.zsh-theme b/themes/michelebologna.zsh-theme new file mode 100644 index 00000000..002d4628 --- /dev/null +++ b/themes/michelebologna.zsh-theme @@ -0,0 +1,43 @@ +# reference colors +GREEN="%{$fg_bold[green]%}" +RED="%{$fg_bold[red]%}" +CYAN="%{$fg_bold[cyan]%}" +YELLOW="%{$fg_bold[yellow]%}" +BLUE="%{$fg_bold[blue]%}" +MAGENTA="%{$fg_bold[magenta]%}" +WHITE="%{$fg_bold[white]%}" + +COLOR_ARRAY=($GREEN $RED $CYAN $YELLOW $BLUE $MAGENTA $WHITE) + +# color reset +RESET_COLOR="%{$reset_color%}" + +# which color should be applied? +USERNAME_NORMAL_COLOR=$WHITE +USERNAME_ROOT_COLOR=$RED +HOSTNAME_NORMAL_COLOR=$BLUE +#for i in `hostname`; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]] +HOSTNAME_ROOT_COLOR=$RED +HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR) +CURRENT_DIR_COLOR=$CYAN + +# zsh commands +USERNAME_COMMAND="%n" +HOSTNAME_COMMAND="%m" +CURRENT_DIR="%~" + +# output: colors + commands +USERNAME_OUTPUT="%(!..$USERNAME_NORMAL_COLOR$USERNAME_COMMAND$RESET_COLOR@)" +HOSTNAME_OUTPUT="$HOSTNAME_COLOR$HOSTNAME_COMMAND$RESET_COLOR" +CURRENT_DIR_OUTPUT="$CURRENT_DIR_COLOR$CURRENT_DIR" +LAST_COMMAND_OUTPUT="%(?.%(!.$RED.$GREEN).$YELLOW)" + +# git theming +ZSH_THEME_GIT_PROMPT_PREFIX="(" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY=")$RED*" +ZSH_THEME_GIT_PROMPT_CLEAN=")" + +# wrap all together +PROMPT='$USERNAME_OUTPUT$HOSTNAME_OUTPUT:$CURRENT_DIR_OUTPUT $LAST_COMMAND_OUTPUT%#$RESET_COLOR ' +RPROMPT='%1(j.fg: [%j].) $GREEN$(git_prompt_info)$RESET_COLOR [%@]' From 0b6e7358850f7fd74556289b1e0c1634896ed66b Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Tue, 5 Mar 2013 23:01:00 +0100 Subject: [PATCH 2/2] added comment for auto-generated hostname color --- themes/michelebologna.zsh-theme | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/michelebologna.zsh-theme b/themes/michelebologna.zsh-theme index 002d4628..ef4c6d74 100644 --- a/themes/michelebologna.zsh-theme +++ b/themes/michelebologna.zsh-theme @@ -16,6 +16,7 @@ RESET_COLOR="%{$reset_color%}" USERNAME_NORMAL_COLOR=$WHITE USERNAME_ROOT_COLOR=$RED HOSTNAME_NORMAL_COLOR=$BLUE +# uncomment next line if you want auto-generated hostname color #for i in `hostname`; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]] HOSTNAME_ROOT_COLOR=$RED HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR)