dotfiles/install.sh
theanonymousexyz 78639d8876
Changes
2022-05-22 18:08:26 +02:00

39 lines
1 KiB
Bash
Executable file

#!/usr/bin/env sh
cd -P -- "$(readlink -e "$(dirname "$0")")" || exit 255
echo "=> Checking dependencies..."
command -v stow >/dev/null 2>&1 || { echo "Please install GNU Stow!"; exit 1; }
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 1
fi
sleep 0.5
echo "=> Installing dotfile packages..."
for pkg in "$@"; do
sleep 0.1
echo " -> Stowing $pkg"
# Symlink only the individual files instead of the entire directory
[ "$pkg" = "zsh" ] && mkdir -p "$HOME/.config/$pkg"
[ "$pkg" = "scripts" ] && mkdir -p "$HOME/.local/bin"
stow -t "$HOME" --ignore="README.md" "$pkg"
done
sleep 0.5
echo "=> Done!"