workspace/arch-user/install.sh
2024-12-15 23:37:24 +00:00

41 lines
817 B
Bash

#!/bin/bash
set -e
cd "$(dirname "$0")"
umask 002
########## scripts #############
cp -rf scripts/* ~/scripts
################################
########### config #############
source config/theme.sh
VARS=$(printenv | \
grep -E 'THEME_.*' | \
sed -e 's/[= ].*//g' | sed -e 's/^/\$/' | tr '\n' ' '
)
cp_subst() {
mkdir -p "$(dirname "$2")"
envsubst "$VARS" < "$1" > "$2"
}
# simple
cp -rf config/foot ~/.config
cp -rf config/i3blocks ~/.config
cp -rf config/git ~/.config
cp -rf config/vim ~/.config
cp -rf config/xkb ~/.config
# non-xdg
cp -rf config/bash/bashrc ~/.bashrc
# templated
cp_subst config/sway/config.tmpl ~/.config/sway/config
# dynamic
cp -rf config/profile ~/.profile
cat config/bemenu/config.sh >> ~/.profile
cat config/theme.sh >> ~/.profile
################################
swaymsg reload