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
swytch a94e6be43c fix: change echo commands to printf commands
`printf` behaviour is more predictable then `echo` because bash is just
overdoing things
2020-06-20 11:39:37 +02:00

166 lines
3.2 KiB
Bash
Executable File

#!/bin/sh
######################################################################
# @author : swytch
# @file : arch_setup
# @license : GPLv3
# @created : Wednesday May 20, 2020 17:49:05 CEST
#
# @description : automate the setup of my arch installation
######################################################################
#Lists of apps sorted by type and criticity
base_list="dash xorg-server xorg-xinit xorg-xinput xsetroot sxhkd xss-lock zsh neovim gtk2 brave"
utilities_list="xf86-video-intel pulseaudio pulseaudio-alsa pamixer xprop zsh-syntax-highlighting zsh-history-substring-search dunst dunstify libnotify sxiv xwallpaper redshift htop ffmpeg imagemagick upower pacman-contrib"
fonts_list="fira adobe-source-han-sans-jp-fonts adobe-source-han-sans-cn"
media_list="mpv zathura"
other_list="transmission-gtk texlive-core texlive-bin texlive-latexetra"
git_list="st dwm dmenu slock"
build_list="st dwm dmenu slock"
services_list="netctl-auto@wlp4s0 systemd-timescyncd"
git_clone() {
git clone https://gitlab.com/swy7ch/$1 ~/suckless/$1
printf "\n$1 downloaded!"
cd ~/$1
git remote set-url origin git@gitlab.com:swy7ch/$1
if [ "dotfiles" != $1 ]
git remote add upstream git://git.suckless.org/$1
printf "\n$1 setup complete!"
fi
cd
}
build() {
cd ~/$1
sudo make clean install
printf "\n$1 compilation complete!"
}
install() {
read -p "Installing $APP? (y/N)" validation
if [ $validation = "y" ]; then
yay -S $APP
else
printf "\nSkipping $APP"
fi
}
enable_systemctl() {
sudo systemctl enable $1.service
}
##################################################
############# Let's get things done ##############
##################################################
printf "\nConfiguring Arch..."
# Retrieving yay
# We need git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
printf "\nYAY is here !"
cd ~
printf "\nLet's get the other apps"
# Installing apps
printf "\nInstalling base"
for app in $base_list; do
install $app
done
printf "\nDone."
printf "\nInstalling utilitaries"
for app in $utilities_list; do
install $app
done
printf "\nDone."
printf "\nInstalling fonts"
for app in $fonts_list; do
install $app
done
printf "\nDone."
printf "\nInstalling media apps"
for app in $media_list; do
install $app
done
printf "\nDone."
printf "\nInstalling other apps"
for app in $other_list; do
install $app
done
printf "\nDone."
printf "\nInstalling vim-plug"
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
printf "\nDone."
printf "\nInstallation complete !"
# Symlinking the necessary stuff
printf "\nDownloading personnal git repos..."
for repo in $git_list; do
git_clone $repo
done
printf "\nDone."
printf "\nCompiling tools..."
for tool in $build_list; do
build $tool
done
printf "\nDone."
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"
printf "\nEnabling systemctl services"
for service in $services_list; do
enable_systemctl $service
done
printf "\nDone."
printf "\n"
printf "\n##################################################"
printf "\n"
printf "\nConfiguration complete !\n"