#!/usr/bin/env bash #------------------------------------------------------------------------- # █████╗ ██████╗ ██████╗██╗ ██╗████████╗██╗████████╗██╗ ██╗███████╗ # ██╔══██╗██╔══██╗██╔════╝██║ ██║╚══██╔══╝██║╚══██╔══╝██║ ██║██╔════╝ # ███████║██████╔╝██║ ███████║ ██║ ██║ ██║ ██║ ██║███████╗ # ██╔══██║██╔══██╗██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║╚════██║ # ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ # ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ #------------------------------------------------------------------------- echo "--------------------------------------" echo "-- Network Setup --" echo "--------------------------------------" pacman -S networkmanager dhclient --noconfirm --needed systemctl enable --now NetworkManager echo "--------------------------------------" echo "-- Set Password for Root --" echo "--------------------------------------" echo "Enter password for root user: " passwd root if ! source install.conf; then read -p "Please enter hostname:" hostname read -p "Please enter username:" username echo "username=$username" >> ${HOME}/ArchTitus/install.conf echo "password=$password" >> ${HOME}/ArchTitus/install.conf fi echo "-------------------------------------------------" echo "Setting up mirrors for optimal download " echo "-------------------------------------------------" pacman -S --noconfirm pacman-contrib curl pacman -S --noconfirm reflector rsync iso=$(curl -4 ifconfig.co/country-iso) cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak nc=$(grep -c ^processor /proc/cpuinfo) echo "You have " $nc" cores." echo "-------------------------------------------------" echo "Changing the makeflags for "$nc" cores." sudo sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j$nc"/g' /etc/makepkg.conf echo "Changing the compression settings for "$nc" cores." sudo sed -i 's/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g' /etc/makepkg.conf echo "-------------------------------------------------" echo " Setup Language to US and set locale " echo "-------------------------------------------------" sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen locale-gen timedatectl --no-ask-password set-timezone America/Chicago timedatectl --no-ask-password set-ntp 1 localectl --no-ask-password set-locale LANG="en_US.UTF-8" LC_COLLATE="" LC_TIME="en_US.UTF-8" # Set keymaps localectl --no-ask-password set-keymap us # Hostname hostnamectl --no-ask-password set-hostname $hostname # Add sudo no password rights sed -i 's/^# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers #Add parallel downloading sed -i 's/^#Para/Para/' /etc/pacman.conf #Enable multilib cat <> /etc/pacman.conf [multilib] Include = /etc/pacman.d/mirrorlist EOF pacman -Sy --noconfirm echo -e "\nInstalling Base System\n" PKGS=( 'alsa-plugins' # audio plugins 'alsa-utils' # audio utils 'ark' # compression 'audiocd-kio' 'autoconf' # build 'automake' # build 'base' 'bash-completion' 'bind' 'binutils' 'bison' 'bluedevil' 'bluez' 'bluez-libs' 'breeze' 'breeze-gtk' 'bridge-utils' 'btrfs-progs' 'celluloid' # video players 'cmatrix' 'code' # Visual Studio code 'cronie' 'cups' 'dhcpcd' 'dialog' 'discover' 'dmidecode' 'dnsmasq' 'dolphin' 'dosfstools' 'drkonqi' 'edk2-ovmf' 'efibootmgr' # EFI boot 'exfat-utils' 'flex' 'fuse2' 'fuse3' 'fuseiso' 'gamemode' 'gcc' 'gimp' # Photo editing 'git' 'gparted' # partition management 'gptfdisk' 'groff' 'grub' 'grub-customizer' 'gst-libav' 'gst-plugins-good' 'gst-plugins-ugly' 'haveged' 'htop' 'iptables-nft' 'jdk-openjdk' # Java 17 'kactivitymanagerd' 'kate' 'kvantum-qt5' 'kcalc' 'kcharselect' 'kcron' 'kde-cli-tools' 'kde-gtk-config' 'kdecoration' 'kdenetwork-filesharing' 'kdeplasma-addons' 'kdesdk-thumbnailers' 'kdialog' 'keychain' 'kfind' 'kgamma5' 'kgpg' 'khotkeys' 'kinfocenter' 'kitty' 'kmenuedit' 'kmix' 'konsole' 'kscreen' 'kscreenlocker' 'ksshaskpass' 'ksystemlog' 'ksystemstats' 'kwallet-pam' 'kwalletmanager' 'kwayland-integration' 'kwayland-server' 'kwin' 'kwrite' 'kwrited' 'layer-shell-qt' 'libguestfs' 'libkscreen' 'libksysguard' 'libnewt' 'libtool' 'linux' 'linux-lts' 'linux-firmware' 'linux-headers' 'lsof' 'lutris' 'lzop' 'm4' 'make' 'milou' 'nano' 'neofetch' 'networkmanager' 'ntfs-3g' 'okular' 'openbsd-netcat' 'openssh' 'os-prober' 'oxygen' 'p7zip' 'pacman-contrib' 'patch' 'picom' 'pkgconf' 'plasma-browser-integration' 'plasma-desktop' 'plasma-disks' 'plasma-firewall' 'plasma-integration' 'plasma-nm' 'plasma-pa' 'plasma-sdk' 'plasma-systemmonitor' 'plasma-thunderbolt' 'plasma-vault' 'plasma-workspace' 'plasma-workspace-wallpapers' 'polkit-kde-agent' 'powerdevil' 'powerline-fonts' 'print-manager' 'pulseaudio' 'pulseaudio-alsa' 'pulseaudio-bluetooth' 'python-pip' 'qemu' 'rsync' 'sddm-kcm' 'spectacle' 'steam' 'sudo' 'swtpm' 'synergy' 'systemsettings' 'terminus-font' 'texinfo' 'traceroute' 'ufw' 'unrar' 'unzip' 'usbutils' 'vde2' 'vim' 'virt-manager' 'virt-viewer' 'wget' 'which' 'wine-gecko' 'wine-mono' 'winetricks' 'xdg-desktop-portal-kde' 'xdg-user-dirs' 'xorg-server' 'xorg-xinit' 'zeroconf-ioslave' 'zip' 'zsh' 'zsh-syntax-highlighting' 'zsh-autosuggestions' ) for PKG in "${PKGS[@]}"; do echo "INSTALLING: ${PKG}" sudo pacman -S "$PKG" --noconfirm --needed done # # determine processor type and install microcode # proc_type=$(lscpu | awk '/Vendor ID:/ {print $3}') case "$proc_type" in GenuineIntel) print "Installing Intel microcode" pacman -S --noconfirm intel-ucode proc_ucode=intel-ucode.img ;; AuthenticAMD) print "Installing AMD microcode" pacman -S --noconfirm amd-ucode proc_ucode=amd-ucode.img ;; esac # Graphics Drivers find and install if lspci | grep -E "NVIDIA|GeForce"; then sudo cat < /etc/pacman.d/hooks/nvidia.hook [Trigger] Operation=Install Operation=Upgrade Operation=Remove Type=Package Target=nvidia [Action] Depends=mkinitcpio When=PostTransaction Exec=/usr/bin/mkinitcpio -P EOF pacman -S nvidia-dkms dkms --noconfirm --needed elif lspci | grep -E "Radeon"; then pacman -S xf86-video-amdgpu --noconfirm --needed elif lspci | grep -E "Integrated Graphics Controller"; then pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils --needed --noconfirm fi echo -e "\nDone!\n" if [ $(whoami) = "root" ]; then [ ! -d "/home/$username" ] && useradd -m -g users -G wheel -s /bin/bash $username cp -R /root/ArchTitus /home/$username/ echo "--------------------------------------" echo "-- Set Password for $username --" echo "--------------------------------------" echo "Enter password for $username user: " passwd $username cp /etc/skel/.bash_profile /home/$username/ cp /etc/skel/.bash_logout /home/$username/ cp /etc/skel/.bashrc /home/$username/.bashrc chown -R $username: /home/$username sed -n '#/home/'"$username"'/#,s#bash#zsh#' /etc/passwd else echo "You are already a user proceed with aur installs" fi