From e4d2d27af4ba10ae456b5676f3b70573b01d9538 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Sun, 19 Aug 2018 22:28:37 +0200 Subject: [PATCH] Agnoster: solarized light variant (#4680) * agnoster: do not hardcode black foreground. This would allow easy customization when using light color schemes, like solarized-light * agnoster: implement light theme variant Use same variable as in blinks theme, to detect if solarized theme used is a light or dark one. --- themes/agnoster.zsh-theme | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index d91f98735..d1a69c560 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -16,6 +16,10 @@ # using it on Mac OS X, [iTerm 2](https://iterm2.com/) over Terminal.app - # it has significantly better color fidelity. # +# If using with "light" variant of the Solarized color schema, set +# SOLARIZED_THEME variable to "light". If you don't specify, we'll assume +# you're using the "dark" variant. +# # # Goals # # The aim of this theme is to only show you *relevant* information. Like most @@ -30,6 +34,11 @@ CURRENT_BG='NONE' +case ${SOLARIZED_THEME:-dark} in + light) CURRENT_FG='white';; + *) CURRENT_FG='black';; +esac + # Special Powerline characters () { @@ -101,7 +110,7 @@ prompt_git() { if [[ -n $dirty ]]; then prompt_segment yellow black else - prompt_segment green black + prompt_segment green $CURRENT_FG fi if [[ -e "${repo_path}/BISECT_LOG" ]]; then @@ -164,7 +173,7 @@ prompt_hg() { st='±' else # if working copy is clean - prompt_segment green black + prompt_segment green $CURRENT_FG fi echo -n $(hg prompt "☿ {rev}@{branch}") $st else @@ -178,7 +187,7 @@ prompt_hg() { prompt_segment yellow black st='±' else - prompt_segment green black + prompt_segment green $CURRENT_FG fi echo -n "☿ $rev@$branch" $st fi @@ -187,7 +196,7 @@ prompt_hg() { # Dir: current working directory prompt_dir() { - prompt_segment blue black '%~' + prompt_segment blue $CURRENT_FG '%~' } # Virtualenv: current working virtualenv