Skip to content

Instantly share code, notes, and snippets.

@lachiefish
Last active March 23, 2023 05:42
Show Gist options
  • Save lachiefish/ae18bd1b300525476ba20bb621b3bf71 to your computer and use it in GitHub Desktop.
Save lachiefish/ae18bd1b300525476ba20bb621b3bf71 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Check if user is NOT root
if [ "$id -u" = 0 ]; then
echo "Please DO NOT run this script as root"
sleep 3
exit 1
fi
# Base devel
echo "Updating system..."
sleep 3
sudo pacman -Syu --needed --noconfirm git base-devel
# Install yay
echo "Installing yay..."
sleep 3
git clone https://aur.archlinux.org/yay.git /var/tmp/yay
cd /var/tmp/yay
makepkg -si --noconfirm
cd -
rm -rf /var/tmp/yay
# Install dotbare
echo "Installing dotbare..."
sleep 3
yay -S --needed --noconfirm dotbare
# Install dotfiles
echo "Installing dotfiles..."
sleep 3
dotbare finit -u https://github.com/lachiefish/dotfiles.git
# Install packages
echo "Installing packages..."
sleep 3
yay -S - --needed --noconfirm <$HOME/.config/package_list_yay.txt
# Enable systemd services
echo "Enabling services..."
sleep 3
sudo systemctl enable --now NetworkManager
sudo systemctl enable --now bluetooth
# NPM stuff
echo "Installing NVM..."
sleep 3
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | XDG_CONFIG_HOME=$HOME/.config bash
nvm install node
nvm use node
# Install lunarvim
echo "Installing LunarVim..."
sleep 3
LV_BRANCH='release-1.2/neovim-0.8' bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/fc6873809934917b470bff1b072171879899a36b/utils/installer/install.sh) --yes
rm -rf $HOME/.config/lvim.old
# Install nerd fonts
echo "Installing CaskaydiaCove Nerd Font..."
sleep 3
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/CascadiaCode.zip
mkdir ./CascadiaCode && unzip ./CascadiaCode.zip -d ./CascadiaCode
cd ./CascadiaCode && rm *Windows*.otf && mkdir -p $HOME/.local/share/fonts && \
cp *.otf $HOME/.local/share/fonts && fc-cache -f -v
# Reset dotbare
echo "Resetting dotbare to origin/master... Just in case a config has been overwritten..."
sleep 3
dotbare fetch origin
dotbare reset --hard origin/master
sudo usermod -aG wheel,seat,input,video $USER
while true; do
read -p "Remove lachiefish's dotfile repo? This will let you use your own repo (y/n) " yn
case $yn in
[yY])
echo "Deleting lachiefish's dotfile repo ($HOME/.cfg)..."
rm -rf $HOME/.cfg
break
;;
[nN])
echo "Okay!"
break
;;
*) echo invalid response ;;
esac
done
while true; do
read -p "Set your login shell to ZSH? (y/n) " yn
case $yn in
[yY])
echo "chsh -s /bin/zsh"
sudo chsh -s /bin/zsh $USER
break
;;
[nN])
echo "Fine then..."
break
;;
*) echo invalid response ;;
esac
done
while true; do
read -p "Suggested to reboot now (y/n) " yn
case $yn in
[yY])
echo "Rebooting!"
sleep 2
sudo reboot
break
;;
[nN])
echo "Okay, you should at least log out..."
exit
;;
*) echo invalid response ;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment