dotfiles/deploy.sh

74 lines
1.9 KiB
Bash
Raw Normal View History

2020-11-21 15:36:35 +02:00
#!/bin/zsh
2020-11-21 15:36:35 +02:00
# This is a script that should be ran once
# on a new system. Dotdrop will take it from there.
# It is higly tailored to my own needs and
# you (the random person on the internet) should probably not run it
2020-11-21 15:36:35 +02:00
export DOTREPO="$HOME/git/dotfiles"
DISTRO="$(lsb_release -ds | sed 's/"//g')"
2020-11-21 15:59:54 +02:00
PKGLIST="python-ruamel-yaml python-magic-git python-jinja python-docopt"
2020-11-21 15:36:35 +02:00
if [ -d $DOTREPO ]; then
print "Dotfile repository already exists, exiting..."
exit 1
fi
if [ "$DISTRO" -ne "Arch Linux" ]; then
print "Not running on Arch Linux"
print "Other distros not supported, exiting..."
exit 1
fi
2020-11-21 15:36:35 +02:00
# install neovim if not installed
if ! [ -x "$(command -v nvim)" ]; then
read -p "Install neovim? [Y/n] " -i "y" INVIM
if [ "$(tr '[:upper:]' ':lower:' $INVIM)" -eq "y" ]; then
print "Installing neovim"
PKGLIST=$PKGLIST + " neovim neovim-dropin"
fi
fi
# install zsh if not installed
if ! [ -x "$(command -v zsh)" ]; then
read -p "Install zsh? [Y/n] " -i "y" IZSH
if [ "$(tr '[:upper:]' ':lower:' $INVIM)" -eq "y" ]; then
print "Installing zsh"
PKGLIST=$PKGLIST + " zsh"
fi
fi
2020-11-21 15:36:35 +02:00
# install paru if not installed
if ! [ -x "$(command -v paru)" ]; then
read -p "Install paru? [Y/n] " -i "y" IYAY
if [ "$(tr '[:upper:]' ':lower:' $IYAY)" -eq "y" ]; then
2020-11-21 15:36:35 +02:00
print "Installing paru"
sudo pacman -Syu --needed --noconfirm git wget base-devel
cd
wget https://aur.archlinux.org/cgit/aur.git/snapshot/paru-bin.tar.gz
2020-11-21 15:57:41 +02:00
tar xfv paru-bin.tar.gz
cd paru-bin
2020-11-21 15:36:35 +02:00
makepkg -si --noconfirm
cd ..
rm -r paru*
fi
fi
if [ $PKGLIST -ne "" ]
if ! [ -x "$(command -v paru)" ]; then
print "Can't continue without paru"
paru -S $PKGLIST
fi
fi
2020-11-21 15:36:35 +02:00
mkdir ~/git
git clone https://git.korhonen.cc/ReekyMarko/dotfiles.git $DOTREPO
cd ~/git/dotfiles
git submodule init
git submodule update
$DOTREPO/dotdrop.sh --cfg=$DOTREPO/config-home.yaml install
chsh -s /bin/zsh
zsh -c "source ~/.zshrc; sdotdrop install"