larbs

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 4186e8968b56fdcd94c3f61d75e93de1180ff803
parent 95df15576bb2c198dfd17479e9e62cd932629462
Author: Luke <luke@lukesmith.xyz>
Date:   Thu,  5 Oct 2017 02:33:45 -0700

less intimidating name, now that install script more robust

Diffstat:
Aarch.sh | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ddont_run_me.sh | 99-------------------------------------------------------------------------------
Muser.sh | 12+++++++++---
3 files changed, 108 insertions(+), 102 deletions(-)

diff --git a/arch.sh b/arch.sh @@ -0,0 +1,99 @@ +#!/bin/bash + +#This is a lazy script I have for auto-installing Arch. +#It's not officially part of LARBS, but I use it for testing. +#DO NOT RUN THIS YOURSELF because Step 1 is it reformatting /dev/sda WITHOUT confirmation, +#which means RIP in peace qq your data unless you've already backed up all of your drive. + +pacman -S --noconfirm dialog || (echo "Error at script start: Are you sure you're running this as the root user? Are you sure you have an internet connection?" && exit) +RED='\033[0;31m' +BLUE='\033[0;34m' +NC='\033[0m' + +#error() { dialog --title "Error!" --msgbox "We've run into a fatal-ish error. Check the LARBS.log file for more information" 10 60 && clear && exit ;} + +dialog --defaultno --title "DON'T BE A BRAINLET!" --yesno "This is an Arch install script that is very rough around the edges.\n\nOnly run this script if you're a big-brane who doesn't mind deleting your entire /dev/sda drive.\n\nThis script is only really for me so I can autoinstall Arch.\n\nt. Luke" 15 60 || exit + +dialog --defaultno --title "DON'T BE A BRAINLET!" --yesno "Do you think I'm meming? Only select yes to DELET your entire /dev/sda and reinstall Arch.\n\nTo stop this script, press no." 10 60 || exit + +dialog --no-cancel --inputbox "Enter a name for your computer." 10 60 2> comp + +timedatectl set-ntp true + +cat <<EOF | fdisk /dev/sda +o +n +p + + ++200M +n +p + + ++12G +n +p + + ++25G +n +p + + +w +EOF +partprobe + +mkfs.ext4 /dev/sda4 +mkfs.ext4 /dev/sda3 +mkfs.ext4 /dev/sda1 +mkswap /dev/sda2 +swapon /dev/sda2 +mount /dev/sda3 /mnt +mkdir /mnt/boot +mount /dev/sda1 /mnt/boot +mkdir /mnt/home +mount /dev/sda4 /mnt/home + +cat comp > /mnt/etc/hostname && rm comp + +pacstrap /mnt base base-devel + +genfstab -U /mnt >> /mnt/etc/fstab + +curl http://lukesmith.xyz/larbs/chroot.sh > /mnt/chroot.sh && arch-chroot /mnt bash chroot.sh && rm /mnt/chroot.sh + +grubinst() { pacman -S grub && grub-install --target=i386-pc /dev/sda ;} + +echo "Install and configure GRUB bootloader? [y/N]" +read yn +case $yn in + [Yy]* ) grubinst ;; + [yes]* ) grubinst ;; + [Yes]* ) grubinst ;; +esac + +echo "Eject CD/ROM? [y/N]" +read yn +case $yn in + [Yy]* ) eject ;; + [yes]* ) eject ;; + [Yes]* ) eject ;; +esac + +echo "Reboot now? [y/N]" +read yn +case $yn in + [Yy]* ) reboot ;; + [yes]* ) reboot ;; + [Yes]* ) reboot ;; +esac + +echo "Return to chroot environment? [y/N]" +read yn +case $yn in + [Yy]* ) arch-chroot /mnt ;; + [yes]* ) arch-chroot /mnt ;; + [Yes]* ) arch-chroot /mnt ;; +esac diff --git a/dont_run_me.sh b/dont_run_me.sh @@ -1,99 +0,0 @@ -#!/bin/bash - -#This is a lazy script I have for auto-installing Arch. -#It's not officially part of LARBS, but I use it for testing. -#DO NOT RUN THIS YOURSELF because Step 1 is it reformatting /dev/sda WITHOUT confirmation, -#which means RIP in peace qq your data unless you've already backed up all of your drive. - -pacman -S --noconfirm dialog || (echo "Error at script start: Are you sure you're running this as the root user? Are you sure you have an internet connection?" && exit) -RED='\033[0;31m' -BLUE='\033[0;34m' -NC='\033[0m' - -#error() { dialog --title "Error!" --msgbox "We've run into a fatal-ish error. Check the LARBS.log file for more information" 10 60 && clear && exit ;} - -dialog --defaultno --title "DON'T BE A BRAINLET!" --yesno "Have you seen this file's filename? It's DONT_RUN_ME.SH!\n\nOnly run this script if you're a big-brane who doesn't mind deleting your entire /dev/sda drive.\n\nThis script is only really for me so I can autoinstall Arch.\n\nt. Luke" 15 60 || exit - -dialog --defaultno --title "DON'T BE A BRAINLET!" --yesno "Do you think I'm meming? Only select yes to DELET your entire /dev/sda and reinstall Arch.\n\nTo stop this script, press no." 10 60 || exit - -dialog --no-cancel --inputbox "Enter a name for your computer." 10 60 2> comp - -timedatectl set-ntp true - -cat <<EOF | fdisk /dev/sda -o -n -p - - -+200M -n -p - - -+12G -n -p - - -+25G -n -p - - -w -EOF -partprobe - -mkfs.ext4 /dev/sda4 -mkfs.ext4 /dev/sda3 -mkfs.ext4 /dev/sda1 -mkswap /dev/sda2 -swapon /dev/sda2 -mount /dev/sda3 /mnt -mkdir /mnt/boot -mount /dev/sda1 /mnt/boot -mkdir /mnt/home -mount /dev/sda4 /mnt/home - -cat comp > /mnt/etc/hostname && rm comp - -pacstrap /mnt base base-devel - -genfstab -U /mnt >> /mnt/etc/fstab - -curl http://lukesmith.xyz/larbs/chroot.sh > /mnt/chroot.sh && arch-chroot /mnt bash chroot.sh && rm /mnt/chroot.sh - -grubinst() { pacman -S grub && grub-install --target=i386-pc /dev/sda ;} - -echo "Install and configure GRUB bootloader? [y/N]" -read yn -case $yn in - [Yy]* ) grubinst ;; - [yes]* ) grubinst ;; - [Yes]* ) grubinst ;; -esac - -echo "Eject CD/ROM? [y/N]" -read yn -case $yn in - [Yy]* ) eject ;; - [yes]* ) eject ;; - [Yes]* ) eject ;; -esac - -echo "Reboot now? [y/N]" -read yn -case $yn in - [Yy]* ) reboot ;; - [yes]* ) reboot ;; - [Yes]* ) reboot ;; -esac - -echo "Return to chroot environment? [y/N]" -read yn -case $yn in - [Yy]* ) arch-chroot /mnt ;; - [yes]* ) arch-chroot /mnt ;; - [Yes]* ) arch-chroot /mnt ;; -esac diff --git a/user.sh b/user.sh @@ -14,15 +14,18 @@ pulseaudio --start printf "${BLUE}Installing packer as an AUR manager...\n${NC}" aurinstall() { curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/$1.tar.gz && tar -xvf $1.tar.gz && cd $1 && makepkg --noconfirm -si && cd .. && rm -rf $1 $1.tar.gz ;} + qm=$(pacman -Qm | awk '{print $1}') + aurcheck() { for arg in "$@" do if [[ $qm = *"$arg"* ]]; then - echo $arg already installed. + echo $arg is already installed. else echo $arg not installed - aurinstall $arg + printf "${BLUE}\nNow installing $arg...\n${NC}" + aurinstall $arg && printf "${BLUE}\n$arg now installed.\n${NC}" fi done } @@ -31,6 +34,9 @@ aurcheck packer || (echo "Error installing packer." >> LARBS.log && error) printf "${BLUE}Installing AUR programs...\n${NC}" printf "${BLUE}(May take some time.)\n${NC}" +#Add the needed gpg key for neomutt + gpg --recv-keys 5FAF0A6EE7371805 + aurcheck i3-gaps vim-pathogen neofetch i3lock tamzen-font-git neomutt unclutter-xfixes-git urxvt-resize-font-git polybar-git python-pywal xfce-theme-blackbird || (echo "Error installing AUR packages. Check your internet connections and pacman keys." >> LARBS.log && error) #packer --noconfirm -S ncpamixer-git speedometer cli-visualizer @@ -42,6 +48,7 @@ do 1) printf "\n${BLUE}Now installing LaTeX packages...\n${NC}" aurcheck vim-live-latex-preview + git clone https://github.com/lukesmithxyz/latex-templates.git && mkdir -p /home/$USER/Documents/LaTeX && rsync -va latex-templates /home/$USER/Documents/LaTeX && rm -rf latex-templates ;; 6) printf "\n${BLUE}Now installing extra fonts...\n${NC}" @@ -71,7 +78,6 @@ done printf "${BLUE}Downloading config files...\n${NC}" git clone https://github.com/lukesmithxyz/voidrice.git && rsync -va voidrice/ /home/$USER && rm -rf voidrice -git clone https://github.com/lukesmithxyz/latex-templates.git && mkdir -p /home/$USER/Documents/LaTeX && rsync -va latex-templates /home/$USER/Documents/LaTeX && rm -rf latex-templates printf "${BLUE}Generating bash/ranger/qutebrowser shortcuts...\n${NC}" python ~/.config/Scripts/shortcuts.py