2024-05-22 16:11:29 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# what directories should be installable by all users including the root user
|
|
|
|
base=(
|
2024-06-01 10:21:28 +00:00
|
|
|
sway
|
2024-05-22 16:11:29 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# folders that should, or only need to be installed for a local user
|
|
|
|
useronly=(
|
|
|
|
nvim
|
2024-06-01 10:21:28 +00:00
|
|
|
waybar
|
|
|
|
hypr
|
2024-05-22 16:11:29 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# 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
|
2024-06-01 10:21:28 +00:00
|
|
|
if ! [[ "$(whoami)" = *"root"* ]]; then
|
2024-05-22 16:11:29 +00:00
|
|
|
stowit "${HOME}" $app
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "##### ALL DONE"
|