2020-11-21 15:36:35 +02:00
|
|
|
#!/bin/zsh
|
2019-10-26 20:05:31 +03:00
|
|
|
|
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
|
2019-10-26 20:05:31 +03:00
|
|
|
|
2020-11-21 15:36:35 +02:00
|
|
|
export DOTREPO="$HOME/git/dotfiles"
|
|
|
|
DISTRO="$(lsb_release -ds | sed 's/"//g')"
|
2019-10-26 20:05:31 +03:00
|
|
|
|
2020-11-21 15:59:54 +02:00
|
|
|
PKGLIST="python-ruamel-yaml python-magic-git python-jinja python-docopt"
|
2019-10-26 20:05:31 +03:00
|
|
|
|
2020-11-21 15:36:35 +02:00
|
|
|
if [ -d $DOTREPO ]; then
|
|
|
|
print "Dotfile repository already exists, exiting..."
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-11-02 19:09:01 +02:00
|
|
|
|
|
|
|
if [ "$DISTRO" -ne "Arch Linux" ]; then
|
|
|
|
print "Not running on Arch Linux"
|
|
|
|
print "Other distros not supported, exiting..."
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-10-26 20:05:31 +03:00
|
|
|
|
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
|
2019-11-02 19:09:01 +02:00
|
|
|
fi
|
2019-10-26 20:05:31 +03:00
|
|
|
|
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
|
2019-11-02 19:09:01 +02:00
|
|
|
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
|
2019-11-02 19:09:01 +02:00
|
|
|
fi
|
|
|
|
fi
|
2019-10-26 20:05:31 +03:00
|
|
|
|
2020-11-21 15:36:35 +02:00
|
|
|
mkdir ~/git
|
|
|
|
git clone https://git.korhonen.cc/ReekyMarko/dotfiles.git $DOTREPO
|
|
|
|
cd ~/git/dotfiles
|
2019-10-26 20:05:31 +03:00
|
|
|
git submodule init
|
|
|
|
git submodule update
|
2019-11-02 19:09:01 +02:00
|
|
|
$DOTREPO/dotdrop.sh --cfg=$DOTREPO/config-home.yaml install
|
2019-10-26 20:05:31 +03:00
|
|
|
chsh -s /bin/zsh
|
2019-11-02 19:09:01 +02:00
|
|
|
zsh -c "source ~/.zshrc; sdotdrop install"
|