diff options
Diffstat (limited to 'apply_params.sh')
-rwxr-xr-x | apply_params.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/apply_params.sh b/apply_params.sh new file mode 100755 index 0000000..0a12d30 --- /dev/null +++ b/apply_params.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +function colourAdjust() { + local r g b + r="0x${1:1:2}" + g="0x${1:3:2}" + b="0x${1:5:2}" + # r=$((255-r)); g=$((255-g)); b=$((255-b)) + printf '#%02x%02x%02x' $r $g $b +} + +params=( + SS 600 + cBG "$(colourAdjust "#ffffff")" + cFG "$(colourAdjust "#000000")" + cInvFG "$(colourAdjust "#ffffff")" + cFGdisabled "$(colourAdjust "#eeeeee")" + cFGinvalid "$(colourAdjust "#ff0000")" + cBGdigitLargeSelected "$(colourAdjust "#bbbbbb")" + cBGdigitSmallSelected "$(colourAdjust "#aaaaaa")" + cGiven "$(colourAdjust "#000000")" + cNotGiven "$(colourAdjust "#000099")" + cMajor "$(colourAdjust "#111111")" + cMinor "$(colourAdjust "#333333")" + cMenuLarge "$(colourAdjust "#88ff88")" + cMenuSmall "$(colourAdjust "#9999ff")" + cSelFill "$(colourAdjust "#eeeeff")" + cSelCell "$(colourAdjust "#cccccc")" + cSelNum "$(colourAdjust "#f8f8dd")" +) + +nparams=${#params[@]} + +text="$(cat)" +for i in $(seq 0 2 $((nparams-1))); do + from="${params[$i]}" + to="${params[$((i+1))]}" + text="$(sed "s/@@$from@@/$to/g" <<<"$text" | sed "s/@@\"$from\"@@/\"$to\"/")" +done + +cat <<<"$text" |