#!/usr/bin/env bash # shellcheck disable=SC1091 # shellcheck source=./setup.conf CONFIG_FILE=$(pwd)/setup.conf if [[ -f "$CONFIG_FILE" ]]; then source "$CONFIG_FILE" else echo "Missing file: setup.conf" exit 1 fi title basic installations install_pkg networkmanager dhclient reflector \ rsync grub btrfs-progs arch-install-scripts \ git pacman-contrib curl title Network Setup systemctl enable --now NetworkManager install_xorg() { install_pkg "xorg xorg-server" } CPU="$(grep -c ^processor /proc/cpuinfo)" echo -ne " ------------------------------------------------------------------------- You have \"$CPU\" cores. And changing the makeflags for \"$CPU\" cores. As well as changing the compression settings. ------------------------------------------------------------------------- " TOTALMEM="$(grep -i "memtotal" "/proc/meminfo" | grep -o '[[:digit:]]*')" if [[ $TOTALMEM -gt 8000000 ]]; then sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$CPU\"/g" /etc/makepkg.conf sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $CPU -z -)/g" /etc/makepkg.conf fi title Setup Language and set locale # sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen echo "$LOCALE" | sed -i "s/\"//g" >>/etc/locale.gen locale-gen timedatectl --no-ask-password set-timezone "$TIMEZONE" timedatectl --no-ask-password set-ntp 1 localectl --no-ask-password set-locale LANG="$LOCALE" LC_TIME="$LOCALE" # Set keymaps # echo "KEYMAP=$KEYMAP" >>/etc/vconsole.conf localectl --no-ask-password set-keymap --no-convert "$KEYMAP" # 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/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf #Enable multilib sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf # pacman -Sy --noconfirm refresh_pacman title Installing desktop case "$DESKTOP" in "default") # cat /root/ArchTitus/pkg-files/pacman-pkgs.txt | while read line while IFS= read -r LINE; do echo "INSTALLING: $LINE" install_pkg "$LINE" done >/etc/hostname else echo "You are already a user proceed with aur installs" fi # Making sure to edit mkinitcpio conf if luks is selected # add encrypt in mkinitcpio.conf before filesystems in hooks if [[ "$LVM" -eq 1 ]]; then sed -i "/^HOOK/s/filesystems/${HOOKS[*]}/" /etc/mkinitcpio.conf elif [[ "$LUKS" -eq 1 ]]; then sed -i "s/^HOOK.*/HOOKS=(${HOOKS[*]})/" /etc/mkinitcpio.conf fi if [[ -f "/etc/mkinitcpio.conf" ]];then # making mkinitcpio with linux kernel echo "Building initramfs" mkinitcpio -p linux fi title SYSTEM READY FOR 2-user.sh