dotfiles/setup.sh
2024-01-03 11:47:06 +01:00

60 lines
1,009 B
Bash
Executable file

#!/usr/bin/env bash
cd "$( dirname "$0" )"
# 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=(
dracula
git
helix
htop
nano
nix
puppet
ssh
i3
sway
terminfo
tmux
vim
zsh
)
# folders that should, or only need to be installed for a local user
useronly=(
alacritty
asciinema
awesome
)
# run the stow command for the passed in directory ($2) in location $1
stowit() {
usr=$1
app=$2
# -v verbose
# -R recursive
# -t target
stow -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"