This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.local/bin/arch_setup

117 lines
2.2 KiB
Plaintext
Raw Normal View History

#!/bin/sh
######################################################################
2020-05-23 15:47:21 +02:00
# @author : swytch
# @file : arch_setup
# @license : MIT
2020-05-23 15:47:21 +02:00
# @created : Wednesday May 20, 2020 17:49:05 CEST
#
2020-05-23 15:47:21 +02:00
# @description : automate the setup of my arch installation
######################################################################
2020-05-06 03:20:19 +02:00
repos="st dwm dmenu slock"
2020-05-06 03:20:19 +02:00
2020-09-03 14:49:30 +02:00
services_list="systemd-timescyncd"
2020-05-06 03:20:19 +02:00
git_clone() {
printf "\nDownloading $1..."
git clone https://gitlab.com/swy7ch/$1 ~/$HOME/.local/src/tools/$1
printf "\tDone."
cd ~/$HOME/.local/src/tools/$1
2020-05-06 03:20:19 +02:00
git remote set-url origin git@gitlab.com:swy7ch/$1
2020-09-03 14:49:30 +02:00
git remote add upstream git://git.suckless.org/$1
printf "\n$1 setup complete!"
2020-05-06 03:20:19 +02:00
cd
}
build() {
cd ~/$1
sudo make clean install
printf "\n$1 compilation complete!"
2020-05-06 03:20:19 +02:00
}
install() {
read -p "\nInstalling $app? [Y/n]" validation
if [ $validation != "n" ]; then
paru -S $app
2020-05-06 03:20:19 +02:00
else
2020-09-03 14:49:30 +02:00
printf "\nSkipping $app"
2020-05-06 03:20:19 +02:00
fi
}
enable_systemctl() {
2020-09-03 14:49:30 +02:00
sudo systemctl enable $1
2020-05-06 03:20:19 +02:00
}
##################################################
############# Let's get things done ##############
##################################################
2020-09-03 14:49:30 +02:00
printf "\nConfiguring Arch...\n"
2020-05-06 03:20:19 +02:00
# Retrieving paru
printf "\nGetting paru..."
2020-05-06 03:20:19 +02:00
git clone https://aur.archlinux.org/paru.git
cd paru
2020-05-06 03:20:19 +02:00
makepkg -si
printf "\nparu is here !"
2020-05-06 03:20:19 +02:00
cd ~
# Installing apps
paru -S --needed - < ~/.config/paru/pkglist.txt
2020-05-06 03:20:19 +02:00
printf "\nInstalling vim-plug..."
2020-05-06 03:20:19 +02:00
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
printf "\tDone."
2020-05-06 03:20:19 +02:00
printf "\nInstallation complete !\n"
2020-05-06 03:20:19 +02:00
# Symlinking the necessary stuff
printf "\nDownloading personnal git repos..."
2020-05-06 03:20:19 +02:00
for repo in $git; do
2020-05-06 03:20:19 +02:00
git_clone $repo
done
printf "\tDone."
2020-05-06 03:20:19 +02:00
printf "\nCompiling tools..."
2020-05-06 03:20:19 +02:00
for tool in $git; do
2020-05-06 03:20:19 +02:00
build $tool
done
printf "\tDone."
2020-05-06 03:20:19 +02:00
printf "\n"
printf "\n!!! Don't forget to link an SSH key to your account !!!"
printf "\n!!! As of now, you can't pull nor push anything !!!"
printf "\n"
2020-05-06 03:20:19 +02:00
printf "\nEnabling systemctl services..."
2020-05-06 03:20:19 +02:00
for service in $services_list; do
enable_systemctl $service
done
printf "\tDone."
2020-05-06 03:20:19 +02:00
printf "\n"
printf "\n##################################################"
printf "\n"
2020-05-06 03:20:19 +02:00
printf "\nConfiguration complete !\n"