Doors/configs/mako/update-theme
2023-06-15 16:36:30 -04:00

20 lines
464 B
Bash
Executable file

#!/bin/sh
. "${HOME}/.cache/wal/colors.sh"
conffile="~/.config/mako/config"
# Associative array, color name -> color code.
declare -A colors
colors=(
["background-color"]="${background}89"
["text-color"]="$foreground"
["border-color"]="$color13"
)
for color_name in "${!colors[@]}"; do
# replace first occurance of each color in config file
sed -i "0,/^$color_name.*/{s//$color_name=${colors[$color_name]}/}" $conffile
done
makoctl reload