dotfiles/setup.sh

49 lines
885 B
Bash
Raw Normal View History

2024-05-08 15:13:04 +00:00
#!/usr/bin/env bash
# make sure we have pulled in and updated any submodules
git submodule init
git submodule update
# what directories should be installable by all users including the root user
base=(
)
# folders that should, or only need to be installed for a local user
useronly=(
bin
git
i3
kitty
nvim
fish
tmux
2024-05-08 15:13:04 +00:00
)
# run the stow command for the passed in directory ($2) in location $1
stowit() {
usr=$1
app=$2
# -v verbose
2024-05-08 15:21:57 +00:00
# -R restow
2024-05-08 15:13:04 +00:00
# -t target
stow --dotfiles -v -R -t "${usr}" "${app}"
}
echo ""
echo "Stowing apps for user: $(whoami)"
# install apps available to local users and root
for app in "${base[@]}"; do
stowit "${HOME}" "$app"
done
# install only user space folders
for app in "${useronly[@]}"; do
if [[ ! "$(whoami)" = *"root"* ]]; then
stowit "${HOME}" "$app"
fi
done
echo ""
echo "##### ALL DONE"