diff options
author | Elizabeth <me@liz.coffee> | 2025-06-02 13:11:10 -0700 |
---|---|---|
committer | Elizabeth <me@liz.coffee> | 2025-06-02 13:11:10 -0700 |
commit | d098e94ad102da9d018acca72ca5a5c554d25a01 (patch) | |
tree | d6d23ee63ad5a1aa4017a605d9e09e75de2c5f49 /dots/home/scripts/theme.sh | |
parent | ede675866355d34ac9fdc1b8e047576f574bdfa2 (diff) | |
download | dotfiles-d098e94ad102da9d018acca72ca5a5c554d25a01.tar.gz dotfiles-d098e94ad102da9d018acca72ca5a5c554d25a01.zip |
Update paths n stuff
Diffstat (limited to 'dots/home/scripts/theme.sh')
-rwxr-xr-x | dots/home/scripts/theme.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dots/home/scripts/theme.sh b/dots/home/scripts/theme.sh new file mode 100755 index 0000000..830f56b --- /dev/null +++ b/dots/home/scripts/theme.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# usage: theme.sh <theme_name> + +source log.sh "theme.sh" + +THEME="$1" +log DEBUG "setting theme $THEME" + +THEME_SRC="$XDG_CONFIG_HOME/theme" +THEME_DEST="$HOME/.theme" +log DEBUG "src $THEME_SRC -> dest $THEME_DEST" + +THEME_TEMPL="{{THEME}}" + +find -L "$THEME_SRC/" -type f | while read source_file; do + destination_file=`echo "$source_file" | sed "s|^$THEME_SRC|$THEME_DEST|g"` + mkdir -p `dirname $destination_file` + log DEBUG "src $source_file -> dest $destination_file" + cat "$source_file" | sed "s|$THEME_TEMPL|$THEME|g" > $destination_file +done + |