2018-11-13 12:56:58 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
file="$(dirname $0)/alacritty.yml"
|
|
|
|
|
2019-06-18 10:44:51 -04:00
|
|
|
prefix=' foreground: '
|
2018-11-13 12:56:58 -05:00
|
|
|
amber="'0xb98000'"
|
|
|
|
green="'0x008000'"
|
|
|
|
color=$amber
|
|
|
|
|
|
|
|
if [ -n "$1" ]
|
|
|
|
then
|
|
|
|
[ "$1" == "green" ] && color=$green
|
|
|
|
else
|
|
|
|
current=$(grep -oP '^'"$prefix"'\K.*$' "$file")
|
|
|
|
echo $current
|
|
|
|
[ "$current" == "$amber" ] && color=$green
|
|
|
|
fi
|
|
|
|
|
|
|
|
sed -i 's/^'"${prefix}"'.*/'"${prefix}${color}"'/' "$file"
|