dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit f329f957f893f53fd56bdb3fdd565a009b84ce65
parent f9f532bb8d22a433cb98ba28123c47607dfdc656
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon,  4 Mar 2019 21:35:20 +0100

Read and apply cursorColor

Diffstat:
Mlinks/bin/colortheme | 48++++++++++++++++++++++++++----------------------
1 file changed, 26 insertions(+), 22 deletions(-)

diff --git a/links/bin/colortheme b/links/bin/colortheme @@ -37,24 +37,25 @@ function get_theme_color { } function report_colors { - echo "foreground: $foreground" - echo "background: $background" - echo "color0: $color0" - echo "color1: $color1" - echo "color2: $color2" - echo "color3: $color3" - echo "color4: $color4" - echo "color5: $color5" - echo "color6: $color6" - echo "color7: $color7" - echo "color8: $color8" - echo "color9: $color9" - echo "color10: $color10" - echo "color11: $color11" - echo "color12: $color12" - echo "color13: $color13" - echo "color14: $color14" - echo "color15: $color15" + echo "foreground: $foreground" + echo "background: $background" + echo "color0: $color0" + echo "color1: $color1" + echo "color2: $color2" + echo "color3: $color3" + echo "color4: $color4" + echo "color5: $color5" + echo "color6: $color6" + echo "color7: $color7" + echo "color8: $color8" + echo "color9: $color9" + echo "color10: $color10" + echo "color11: $color11" + echo "color12: $color12" + echo "color13: $color13" + echo "color14: $color14" + echo "color15: $color15" + echo "cursorColor: $cursorColor" } function get_colors { @@ -78,12 +79,15 @@ function get_colors { color13=$(get_theme_color color13) color14=$(get_theme_color color14) color15=$(get_theme_color color15) + cursorColor=$(get_theme_color cursorColor) + cursorColor=${cursorColor:-#FF00FF} if [[ $foreground == "" || $background == "" || $color0 == "" || \ $color1 == "" || $color2 == "" || $color3 == "" || $color4 == "" || \ $color5 == "" || $color6 == "" || $color7 == "" || $color8 == "" || \ $color9 == "" || $color10 == "" || $color11 == "" || $color12 == "" || \ - $color13 == "" || $color14 == "" || $color15 == "" ]]; then + $color13 == "" || $color14 == "" || $color15 == "" || \ + $cursorColor == "" ]]; then report_colors die 'Error: One or more colors were not defined' @@ -92,7 +96,6 @@ function get_colors { function set_colors { get_colors "$1" - report_colors if [ -f ~/.Xresources ]; then sed -i "s/^\*\.foreground: .*$/\*.foreground: $foreground/;\ @@ -113,7 +116,8 @@ function set_colors { s/^\*\.color13: .*$/\*.color13: $color13/;\ s/^\*\.color14: .*$/\*.color14: $color14/;\ s/^\*\.color15: .*$/\*.color15: $color15/;\ - s/^\*\.color16: .*$/\*.color16: $color16/" ~/.Xresources + s/^\*\.color16: .*$/\*.color16: $color16/;\ + s/^\*\.cursorColor: .*$/\*.cursorColor: $cursorColor/" ~/.Xresources xrdb -merge ~/.Xresources command -v i3-msg >/dev/null 2>&1 && (i3-msg restart || :) [[ -x ~/bin/wallpaper.sh ]] && ~/bin/wallpaper.sh @@ -137,7 +141,7 @@ function set_colors { s/^\t\[12\] = \".*\",.*$/\t\[12\] = \"$color12\",/;\ s/^\t\[13\] = \".*\",.*$/\t\[13\] = \"$color13\",/;\ s/^\t\[14\] = \".*\",.*$/\t\[14\] = \"$color14\",/;\ - s/^\t\[15\] = \".*\",.*$/\t\[15\] = \"$color15\",/"\ + s/^\t\[258\] = \".*\",.*$/\t\[258\] = \"$cursorColor\",/"\ ~/code/st/config.h (cd ~/code/st && sudo make install) fi