i3/.config/alacritty/swapColors.sh

20 lines
370 B
Bash
Executable File

#!/bin/bash
file="$(dirname $0)/alacritty.toml"
prefix='foreground = '
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"