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 0d09a2fecdd76013c18442f4edb2d2cd74fd1abc
parent 9e340c027ae59ef438c8ad0e3a6a8d7ad8617f74
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon,  4 Mar 2019 20:13:38 +0100

Fix replace in st and Xresources

Diffstat:
Mlinks/bin/colortheme | 75++++++++++++++++++++++++++++++++++++++-------------------------------------
1 file changed, 38 insertions(+), 37 deletions(-)

diff --git a/links/bin/colortheme b/links/bin/colortheme @@ -92,49 +92,50 @@ function get_colors { function set_colors { get_colors "$1" + report_colors if [ -f ~/.Xresources ]; then - sed -i "s/^\*.foreground: #.*$/\*.foreground: $foreground/;\ - s/^\*.background: #.*$/\*.background: $background/;\ - s/^\*.color0: #.*$/\*.color0: $color0/;\ - s/^\*.color1: #.*$/\*.color1: $color1/;\ - s/^\*.color2: #.*$/\*.color2: $color2/;\ - s/^\*.color3: #.*$/\*.color3: $color3/;\ - s/^\*.color4: #.*$/\*.color4: $color4/;\ - s/^\*.color5: #.*$/\*.color5: $color5/;\ - s/^\*.color6: #.*$/\*.color6: $color6/;\ - s/^\*.color7: #.*$/\*.color7: $color7/;\ - s/^\*.color8: #.*$/\*.color8: $color8/;\ - s/^\*.color9: #.*$/\*.color9: $color9/;\ - s/^\*.color10: #.*$/\*.color10: $color10/;\ - s/^\*.color11: #.*$/\*.color11: $color11/;\ - s/^\*.color12: #.*$/\*.color12: $color12/;\ - s/^\*.color13: #.*$/\*.color13: $color13/;\ - s/^\*.color14: #.*$/\*.color14: $color14/;\ - s/^\*.color15: #.*$/\*.color15: $color15/;\ - s/^\*.color16: #.*$/\*.color16: $color16/" ~/.Xresources + sed -i "s/^\*\.foreground: #.*$/\*.foreground: $foreground/;\ + s/^\*\.background: #.*$/\*.background: $background/;\ + s/^\*\.color0: .*$/\*.color0: $color0/;\ + s/^\*\.color1: .*$/\*.color1: $color1/;\ + s/^\*\.color2: .*$/\*.color2: $color2/;\ + s/^\*\.color3: .*$/\*.color3: $color3/;\ + s/^\*\.color4: .*$/\*.color4: $color4/;\ + s/^\*\.color5: .*$/\*.color5: $color5/;\ + s/^\*\.color6: .*$/\*.color6: $color6/;\ + s/^\*\.color7: .*$/\*.color7: $color7/;\ + s/^\*\.color8: .*$/\*.color8: $color8/;\ + s/^\*\.color9: .*$/\*.color9: $color9/;\ + s/^\*\.color10: .*$/\*.color10: $color10/;\ + s/^\*\.color11: .*$/\*.color11: $color11/;\ + s/^\*\.color12: .*$/\*.color12: $color12/;\ + s/^\*\.color13: .*$/\*.color13: $color13/;\ + s/^\*\.color14: .*$/\*.color14: $color14/;\ + s/^\*\.color15: .*$/\*.color15: $color15/;\ + s/^\*\.color16: .*$/\*.color16: $color16/" ~/.Xresources xrdb -merge ~/.Xresources fi if [ -f ~/code/st/config.h ]; then - sed -i "s/^\t\[257\] = \"#.*\",.*$/\t\[257\] = \"$foreground\",/;\ - s/^\t\[256\] = \"#.*\",.*$/\t\[256\] = \"$background\",/;\ - s/^\t\[0\] = \"#.*\",.*$/\t\[0\] = \"$color0\",/;\ - s/^\t\[1\] = \"#.*\",.*$/\t\[1\] = \"$color1\",/;\ - s/^\t\[2\] = \"#.*\",.*$/\t\[2\] = \"$color2\",/;\ - s/^\t\[3\] = \"#.*\",.*$/\t\[3\] = \"$color3\",/;\ - s/^\t\[4\] = \"#.*\",.*$/\t\[4\] = \"$color4\",/;\ - s/^\t\[5\] = \"#.*\",.*$/\t\[5\] = \"$color5\",/;\ - s/^\t\[6\] = \"#.*\",.*$/\t\[6\] = \"$color6\",/;\ - s/^\t\[7\] = \"#.*\",.*$/\t\[7\] = \"$color7\",/;\ - s/^\t\[8\] = \"#.*\",.*$/\t\[8\] = \"$color8\",/;\ - s/^\t\[9\] = \"#.*\",.*$/\t\[9\] = \"$color9\",/;\ - s/^\t\[10\] = \"#.*\",.*$/\t\[10\] = \"$color10\",/;\ - s/^\t\[11\] = \"#.*\",.*$/\t\[11\] = \"$color11\",/;\ - s/^\t\[12\] = \"#.*\",.*$/\t\[12\] = \"$color12\",/;\ - s/^\t\[13\] = \"#.*\",.*$/\t\[13\] = \"$color13\",/;\ - s/^\t\[14\] = \"#.*\",.*$/\t\[14\] = \"$color14\",/;\ - s/^\t\[15\] = \"#.*\",.*$/\t\[15\] = \"$color15\",/"\ + sed -i "s/^\t\[257\] = \".*\",.*$/\t\[257\] = \"$foreground\",/;\ + s/^\t\[256\] = \".*\",.*$/\t\[256\] = \"$background\",/;\ + s/^\t\[0\] = \".*\",.*$/\t\[0\] = \"$color0\",/;\ + s/^\t\[1\] = \".*\",.*$/\t\[1\] = \"$color1\",/;\ + s/^\t\[2\] = \".*\",.*$/\t\[2\] = \"$color2\",/;\ + s/^\t\[3\] = \".*\",.*$/\t\[3\] = \"$color3\",/;\ + s/^\t\[4\] = \".*\",.*$/\t\[4\] = \"$color4\",/;\ + s/^\t\[5\] = \".*\",.*$/\t\[5\] = \"$color5\",/;\ + s/^\t\[6\] = \".*\",.*$/\t\[6\] = \"$color6\",/;\ + s/^\t\[7\] = \".*\",.*$/\t\[7\] = \"$color7\",/;\ + s/^\t\[8\] = \".*\",.*$/\t\[8\] = \"$color8\",/;\ + s/^\t\[9\] = \".*\",.*$/\t\[9\] = \"$color9\",/;\ + s/^\t\[10\] = \".*\",.*$/\t\[10\] = \"$color10\",/;\ + s/^\t\[11\] = \".*\",.*$/\t\[11\] = \"$color11\",/;\ + s/^\t\[12\] = \".*\",.*$/\t\[12\] = \"$color12\",/;\ + s/^\t\[13\] = \".*\",.*$/\t\[13\] = \"$color13\",/;\ + s/^\t\[14\] = \".*\",.*$/\t\[14\] = \"$color14\",/;\ + s/^\t\[15\] = \".*\",.*$/\t\[15\] = \"$color15\",/"\ ~/code/st/config.h (cd ~/code/st && sudo make install) fi