2018-11-13 12:56:58 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-12-27 19:56:33 -05:00
|
|
|
file="$(dirname $0)/alacritty.toml"
|
2018-11-13 12:56:58 -05:00
|
|
|
|
2023-12-27 19:56:33 -05:00
|
|
|
prefix='foreground = '
|
|
|
|
amber='"0xb98000"'
|
|
|
|
green='"0x008000"'
|
2018-11-13 12:56:58 -05:00
|
|
|
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"
|