#!/bin/sh cprint(){ RED="\033[0;31m" GREEN="\033[0;32m" YELLOW="\033[1;33m" BLUE="\033[1;34m" GREY="\033[1;30m" NC="\033[0m" # No Color printf "${!1}${2}${NC}" } function prompt () { cprint GREEN '>' read -r -p "$1 [Y/n]" response response=${response,,} [[ $response =~ ^(yes|y| ) ]] || [[ -z $response ]] } function print_status () { if [ $? -eq 0 ]; then cprint GREEN "Success $1\n" else cprint RED "Error\n" fi } buf=$(pwd) prompt 'Install dotfiles' if $(exit $?); then mkdir -p $HOME/apps cd $HOME/apps if [ ! -d $HOME/apps/dotfiles ]; then git clone https://github.com/maicher/dotfiles fi cd $HOME/apps/dotfiles bin/build bin/deploy print_status Dotfiles echo "You can now change shell, run:" echo "chsh" fi cd "$buf" prompt 'Install basic?' if $(exit $?); then sudo pacman -S \ libxft libxinerama make gcc pkg-config base-devel arch-install-scripts git htop openssh rsync man \ archlinux-keyring usbutils pciutils zsh-completions encfs zip unzip udisks2 lf ttf-dejavu-nerd \ xorg-xev xorg-xrandr xorg-xinit xorg-server xorg-xsetroot xorg-drivers xcompmgr sxhkd \ wget parallel exfatprogs cronie lsof iotop \ openvpn bluez bluez-utils pavucontrol pulseaudio pulseaudio-bluetooth pamixer \ perl-rename nitrogen redshift flameshot xclip perl-file-mimeinfo \ lm_sensors cpupower sysstat nmap net-tools bind-tools ethtool picom ntfs-3g lftp \ gopass xdotool gparted print_status fi prompt 'Install for laptop?' if $(exit $?); then sudo pacman -S nvidia nvidia-settings nvidia-utils nvidia-prime xf86-video-intel glxinfo print_status fi prompt 'Install yay?' if $(exit $?); then mkdir -p $HOME/apps/tools cd $HOME/apps/tools git clone https://aur.archlinux.org/yay.git cd yay makepkg -si print_status fi prompt 'Install yay packages?' if $(exit $?); then yay -S zsh-fast-syntax-highlighting universal-ctags bind-tools pytnon2-gimp print_status fi prompt 'Install games?' if $(exit $?); then echo "Enable multilib in /etc/pacman.conf" sudo pacman -Syy sudo pacman -S wine lib32-libpulse print_status fi prompt 'Install rvm?' if $(exit $?); then curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import - curl -sSL https://get.rvm.io | bash -s stable print_status fi prompt 'Install node?' if $(exit $?); then yay -S nvm print_status source /usr/share/nvm/init-nvm.sh nvm install --lts print_status fi prompt 'Install crypto' if $(exit $?); then sudo pacman -S monero monero-gui yay -S xmrig bisq print_status fi prompt 'Install notifications' if $(exit $?); then sudo pacman -S dunst libnotify fi prompt 'Install heroku?' if $(exit $?); then source /usr/share/nvm/init-nvm.sh nvm use node npm install heroku print_status fi prompt 'Install other dev tools?' if $(exit $?); then sudo pacman -S tmux fzf ripgrep the_silver_searcher ctags ruby go gopls yarn redis \ postgresql postgresql-old-upgrade \ docker dbeaver lazygit inotify-tools plantuml print_status fi prompt 'Install xbacklight?' if $(exit $?); then sudo pacman -S xorg-xbacklight print_status fi buf=$(pwd) prompt 'Install DWM and friends?' if $(exit $?); then mkdir -p $HOME/apps/tools cd $HOME/apps/tools if [ ! -d $HOME/apps/tools/dwm ]; then git clone https://github.com/maicher/dwm fi cd $HOME/apps/tools/dwm sudo make clean install print_status DWM cd $HOME/apps/tools if [ ! -d $HOME/apps/tools/dmenu ]; then git clone https://github.com/maicher/dmenu fi cd $HOME/apps/tools/dmenu sudo make clean install print_status dmenu cd $HOME/apps/tools if [ ! -d $HOME/apps/tools/kmstatus ]; then git clone https://github.com/maicher/kmstatus fi cd $HOME/apps/tools/kmstatus sudo make buildx install print_status kmstatus cd $HOME/apps/tools if [ ! -d $HOME/apps/tools/st ]; then git clone https://github.com/LukeSmithxyz/st fi cd $HOME/apps/tools/st sudo make clean install print_status st fi cd "$buf" prompt 'Install other crap?' if $(exit $?); then sudo pacman -S cups ghostscript hplip enscript zathura zathura-ps libreoffice-still pandoc octave mupdf \ firefox thunderbird qbittorrent yt-dlp \ libnotify mpv sxiv ffmpeg audacious gimp obs-studio kdenlive translate-shell print_status fi prompt 'Setup vim?' if $(exit $?); then git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim print_status fi prompt 'Install even other crap with yay?' if $(exit $?); then yay -S google-chrome whatsapp-for-linux gallery-dl brave-bin nvidia-docker print_status fi prompt 'Init and enable postgres?' if $(exit $?); then sudo systemctl enable postgresql --now sudo su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'" sudo su - postgres -c "createuser kjm --superuser" sudo su - postgres -c "createdb kjm" print_status fi prompt 'Enable stuff?' if $(exit $?); then sudo systemctl enable cronie.service --now print_status Cron sudo systemctl enable cups --now print_status Cups sudo systemctl enable bluetooth --now print_status Bluetooth sudo systemctl enable redis --now print_status Redis ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf sudo systemctl restart systemd-resolved fi