e4d2d27af4ba10ae456b5676f3b70573b01d9538

Author
Frederic Crozat <fcrozat@suse.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

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.

Diff

 1diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
 2index d91f987357b827262e7bc134075c5d84121c1df1..d1a69c5600c6e9d5a9597abc32ed1257d2175b65 100644
 3--- a/themes/agnoster.zsh-theme
 4+++ b/themes/agnoster.zsh-theme
 5@@ -16,6 +16,10 @@
 6 # using it on Mac OS X, [iTerm 2](https://iterm2.com/) over Terminal.app -
 7 # it has significantly better color fidelity.
 8 #
 9+# If using with "light" variant of the Solarized color schema, set
10+# SOLARIZED_THEME variable to "light". If you don't specify, we'll assume
11+# you're using the "dark" variant.
12+#
13 # # Goals
14 #
15 # The aim of this theme is to only show you *relevant* information. Like most
16@@ -30,6 +34,11 @@
17 
18 CURRENT_BG='NONE'
19 
20+case ${SOLARIZED_THEME:-dark} in
21+    light) CURRENT_FG='white';;
22+    *)     CURRENT_FG='black';;
23+esac
24+
25 # Special Powerline characters
26 
27 () {
28@@ -101,7 +110,7 @@ prompt_git() {
29     if [[ -n $dirty ]]; then
30       prompt_segment yellow black
31     else
32-      prompt_segment green black
33+      prompt_segment green $CURRENT_FG
34     fi
35 
36     if [[ -e "${repo_path}/BISECT_LOG" ]]; then
37@@ -164,7 +173,7 @@ prompt_hg() {
38         st='±'
39       else
40         # if working copy is clean
41-        prompt_segment green black
42+        prompt_segment green $CURRENT_FG
43       fi
44       echo -n $(hg prompt "☿ {rev}@{branch}") $st
45     else
46@@ -178,7 +187,7 @@ prompt_hg() {
47         prompt_segment yellow black
48         st='±'
49       else
50-        prompt_segment green black
51+        prompt_segment green $CURRENT_FG
52       fi
53       echo -n "☿ $rev@$branch" $st
54     fi
55@@ -187,7 +196,7 @@ prompt_hg() {
56 
57 # Dir: current working directory
58 prompt_dir() {
59-  prompt_segment blue black '%~'
60+  prompt_segment blue $CURRENT_FG '%~'
61 }
62 
63 # Virtualenv: current working virtualenv