diff options
Diffstat (limited to 'themes/adben.zsh-theme')
-rw-r--r-- | themes/adben.zsh-theme | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme index b64714f32..e4774cf0e 100644 --- a/themes/adben.zsh-theme +++ b/themes/adben.zsh-theme @@ -2,12 +2,12 @@ # # # # #README # # -# # This theme provides two customizable header functionalities : +# # This theme provides two customizable header functionalities: # # a) displaying a pseudo-random message from a database of quotations # # (https://en.wikipedia.org/wiki/Fortune_%28Unix%29) -# # b) displaying randomly command line tips from The command line fu +# # b) displaying randomly command line tips from The command line fu # # (http://www.commandlinefu.com) community: in order to make use of this functionality -# # you will need Internet connection. +# # you will need Internet connection. # # This theme provides as well information for the current user's context, like; # # branch and status for the current version control system (git and svn currently # # supported) and time, presented to the user in a non invasive volatile way. @@ -25,11 +25,8 @@ # # -Solarized theme (https://github.com/altercation/solarized/) # # -OS X: iTerm 2 (http://www.iterm2.com/) # # -font Source code pro (https://github.com/adobe/source-code-pro) -# # -# # Author: Adolfo Benedetti -# # email: adolfo.benedetti@gmail.com -# # License: Public Domain -# # This theme's look and feel is based on the Aaron Toponce's zsh theme , more info: +# # +# # This theme's look and feel is based on the Aaron Toponce's zsh theme, more info: # # http://pthree.org/2008/11/23/727/ # # enjoy! ########## COLOR ########### @@ -45,7 +42,7 @@ GREEN_BASE_START="${PR_RESET}${PR_GREY}>${PR_RESET}${PR_GREEN}>${PR_BRIGHT_GREEN GREEN_START_P1="${PR_RESET}${GREEN_BASE_START}${PR_RESET} " DIVISION="${PR_RESET}${PR_RED} < ${PR_RESET}" VCS_DIRTY_COLOR="${PR_RESET}${PR_YELLOW}" -Vcs_CLEAN_COLOR="${PR_RESET}${PR_GREEN}" +VCS_CLEAN_COLOR="${PR_RESET}${PR_GREEN}" VCS_SUFIX_COLOR="${PR_RESET}${PR_RED}› ${PR_RESET}" # ########## COLOR ########### # ########## SVN ########### @@ -72,17 +69,17 @@ function precmd { #Choose from all databases, regardless of whether they are considered "offensive" fortune -a } - #obtains the tip + #obtains the tip ps1_command_tip () { wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed 1d | sed '/^$/d' - } + } prompt_header () { if [[ "true" == "$ENABLE_COMMAND_TIP" ]]; then ps1_command_tip else ps1_fortune - fi - } + fi + } PROMPT_HEAD="${RED_START}${PR_YELLOW}$(prompt_header)${PR_RESET}" # set a simple variable to show when in screen if [[ -n "${WINDOW}" ]]; then @@ -92,9 +89,8 @@ function precmd { # Context: user@directory or just directory prompt_context () { - local user=`whoami` - if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then - echo -n "${PR_RESET}${PR_RED}$user@%m${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}" + if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then + echo -n "${PR_RESET}${PR_RED}$USER@%m${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}" else echo -n "${PR_RESET}${PR_BRIGHT_YELLOW}%~%<<${PR_RESET}" fi @@ -103,11 +99,8 @@ prompt_context () { set_prompt () { # required for the prompt setopt prompt_subst - autoload colors zsh/terminfo - if [[ "$terminfo[colors]" -gt 8 ]]; then - colors - fi - + autoload zsh/terminfo + # ######### PROMPT ######### PROMPT='${PROMPT_HEAD} ${RED_START}$(prompt_context) |