aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Hovorka <[email protected]>2020-10-29 17:10:21 -0600
committerAlexis Hovorka <[email protected]>2020-10-29 17:10:21 -0600
commit12064a21c5441d5487ed2bea547985a7650d7b88 (patch)
treec7dde2df0b2a9bba2e221a94edf9c381d5ffd40f
parentbfdf2194d8c289308288cc49f887b838aba93fd5 (diff)
[feat] Add colorscheme shell script
-rw-r--r--base.yaml1
-rwxr-xr-xbase/colorscheme73
2 files changed, 74 insertions, 0 deletions
diff --git a/base.yaml b/base.yaml
index c2115cb..11bafa6 100644
--- a/base.yaml
+++ b/base.yaml
@@ -20,6 +20,7 @@
~/.bin/qr: base/qr
~/.bin/tldr: base/tldr
~/.capsesc: base/capsesc
+ ~/.colorscheme: base/colorscheme
~/.config/bat/config: base/bat.config
~/.curlrc: base/curlrc
~/.gitconfig: base/gitconfig
diff --git a/base/colorscheme b/base/colorscheme
new file mode 100755
index 0000000..3323c55
--- /dev/null
+++ b/base/colorscheme
@@ -0,0 +1,73 @@
+#!/bin/bash
+# Default Dark scheme by Chris Kempson (http://chriskempson.com)
+
+COLORS=()
+#COLORS[ 0]='18/18/18' # Base 00 - Black
+COLORS[ 0]='00/00/00' # Base 00 - Black
+COLORS[ 1]='ab/46/42' # Base 08 - Red
+COLORS[ 2]='a1/b5/6c' # Base 0B - Green
+COLORS[ 3]='f7/ca/88' # Base 0A - Yellow
+COLORS[ 4]='7c/af/c2' # Base 0D - Blue
+COLORS[ 5]='ba/8b/af' # Base 0E - Magenta
+COLORS[ 6]='86/c1/b9' # Base 0C - Cyan
+COLORS[ 7]='d8/d8/d8' # Base 05 - White
+COLORS[ 8]='58/58/58' # Base 03 - Bright Black
+COLORS[ 9]=${COLORS[1]} # Base 08 - Bright Red
+COLORS[10]=${COLORS[2]} # Base 0B - Bright Green
+COLORS[11]=${COLORS[3]} # Base 0A - Bright Yellow
+COLORS[12]=${COLORS[4]} # Base 0D - Bright Blue
+COLORS[13]=${COLORS[5]} # Base 0E - Bright Magenta
+COLORS[14]=${COLORS[6]} # Base 0C - Bright Cyan
+COLORS[15]='f8/f8/f8' # Base 07 - Bright White
+COLORS[16]='dc/96/56' # Base 09 - Orange
+COLORS[17]='a1/69/46' # Base 0F - Brown
+#COLORS[18]='28/28/28' # Base 01 - Grey 1
+COLORS[18]='18/18/18' # Base 01 - Grey 1
+COLORS[19]='38/38/38' # Base 02 - Grey 2
+COLORS[20]='b8/b8/b8' # Base 04 - Grey 3
+COLORS[21]='e8/e8/e8' # Base 06 - Grey 4
+color_foreground=${COLORS[7]} # Base 05 - White
+color_background=${COLORS[0]} # Base 00 - Black
+
+if [ "${TERM%%-*}" = 'linux' ]; then
+ printf_template='\033]P%X%s'
+ for i in `seq 0 15`; do
+ printf $printf_template $i $(echo ${COLORS[$i]} | tr -d '/')
+ done
+ echo -ne '\e[H\e[2J'
+
+else
+ printf_template='\033]4;%d;rgb:%s\033\\'
+ printf_template_var='\033]%d;rgb:%s\033\\'
+ printf_template_custom='\033]%s%s\033\\'
+
+ max_color=15
+ if [[ $(tput colors) -gt 16 ]]; then max_color=21; fi
+ for i in `seq 0 $max_color`; do
+ printf $printf_template $i ${COLORS[$i]}
+ done
+
+ # foreground / background / cursor color
+ if [ "${TERM%%-*}" != 'st' ]; then
+ printf $printf_template_var 10 $color_foreground
+ if [ "$BASE16_SHELL_SET_BACKGROUND" != false ]; then
+ printf $printf_template_var 11 $color_background
+ if [ "${TERM%%-*}" = 'rxvt' ]; then
+ printf $printf_template_var 708 $color_background # internal border (rxvt)
+ fi
+ fi
+ printf $printf_template_custom 12 ';7' # cursor (reverse video)
+ fi
+
+ # clean up
+ unset max_color
+ unset printf_template
+ unset printf_template_var
+ unset printf_template_custom
+fi
+
+unset COLORS
+unset color_foreground
+unset color_background
+
+export BASE16_THEME='default-dark'