dotfiles/install.sh

36 lines
963 B
Bash
Raw Normal View History

2022-03-06 15:22:37 +00:00
#!/usr/bin/env sh
2022-03-05 19:51:07 +00:00
2022-04-27 13:50:13 +00:00
cd -P -- "$(readlink -e "$(dirname "$0")")" || exit 255
echo "=> Checking dependencies..."
2022-04-27 13:50:13 +00:00
command -v stow >/dev/null 2>&1 || { echo "Please install GNU Stow!"; exit 1; }
sleep 0.5
2022-03-05 19:51:07 +00:00
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!"
2022-04-27 13:50:13 +00:00
exit 2
2022-03-05 19:51:07 +00:00
fi
sleep 0.5
echo "=> Installing dotfile packages..."
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!"