dotfiles/install.sh
2022-04-14 16:24:15 +02:00

36 lines
954 B
Bash
Executable file

#!/usr/bin/env sh
echo "=> Checking dependencies..."
command -v stow >/dev/null 2>&1 || { echo "Please install GNU Stow!"; exit 69; }
sleep 0.5
echo "=> Determining OS..."
if [ "$(uname -o)" = "Android" ] || [ "$(lsb_release -si)" = "Fedora" ]; then
set -- "nvim" "scripts" "zsh"
elif [ "$(lsb_release -si)" = "Debian" ] || [ "$(lsb_release -si)" = "Ubuntu" ]; then
set -- "scripts" "zsh"
elif [ "$(lsb_release -si)" = "Artix" ]; then
set -- "alacritty" "mako" "nvim" "scripts" "sway" "swaylock" "swaynag" "waybar" "zsh"
else
echo "OS not supported!"
exit 420
fi
sleep 0.5
echo "=> Installing dotfile packages..."
cd -P -- "$(readlink -e "$(dirname "$0")")"
for pkg in "$@"; do
sleep 0.1
echo " -> Stowing $pkg"
[ "$pkg" = "zsh" ] && mkdir -p "$HOME/.config/$pkg" # Symlink only the individual files instead of the entire directory
stow -t "$HOME" --ignore="README.md" "$pkg"
done
sleep 0.5
echo "=> Done!"