diff --git a/archcrystal.sh b/archcrystal.sh index d39201d..1034e35 100644 --- a/archcrystal.sh +++ b/archcrystal.sh @@ -1,6 +1,6 @@ #!/bin/bash # Script Name: archcrystal.sh -# Version: 1.2.0 +# Version: 1.2.2 set -a BASE_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" @@ -17,7 +17,7 @@ source $BASE_DIR/setup.conf cp -v *.log /mnt/home/$USERNAME echo -ne " -------------------------------------------------------------------------- - Installation Complete -------------------------------------------------------------------------- + +Installation Complete + " diff --git a/pkgs/aur.txt b/pkgs/aur.txt deleted file mode 100644 index f22af5d..0000000 --- a/pkgs/aur.txt +++ /dev/null @@ -1 +0,0 @@ -nerd-fonts-fira-code diff --git a/pkgs/base.txt b/pkgs/base.txt deleted file mode 100644 index 5ee8875..0000000 --- a/pkgs/base.txt +++ /dev/null @@ -1,48 +0,0 @@ -mesa -xorg -xorg-server -xorg-apps -xorg-drivers -xorg-xkill -xorg-xinit -xterm -base-devel -libx11 -libxft -libxinerama -freetype2 -binutils -dosfstools -linux-headers -usbutils -xdg-user-dirs -alsa-plugins -alsa-utils -bluez -bluez-libs -bluez-utils -dialog -efibootmgr -fuse2 -fuse3 -gcc -gparted -htop -jdk-openjdk -neofetch -ntfs-3g -ntp -openssh -os-prober -p7zip -pulseaudio -pulseaudio-alsa -pulseaudio-bluetooth -python-notify2 -python-psutil -python-pyqt5 -python-pip -ufw -zsh -zsh-syntax-highlighting -zsh-autosuggestions diff --git a/pkgs/desktop-env.txt b/pkgs/desktop-env.txt deleted file mode 100644 index 407566e..0000000 --- a/pkgs/desktop-env.txt +++ /dev/null @@ -1,6 +0,0 @@ -i3-gaps -i3blocks -i3blocks -numlockx -dmenu -rxvt-unicode \ No newline at end of file diff --git a/pkgs/dev-env.txt b/pkgs/dev-env.txt deleted file mode 100644 index 9d569e4..0000000 --- a/pkgs/dev-env.txt +++ /dev/null @@ -1,80 +0,0 @@ -mesa -xorg -xorg-server -xorg-apps -xorg-drivers -xorg-xkill -xorg-xinit -xterm -base-devel -libx11 -libxft -libxinerama -freetype2 -binutils -dosfstools -linux-headers -usbutils -xdg-user-dirs -alsa-plugins -alsa-utils -bluez -bluez-libs -bluez-utils -bridge-utils -dialog -efibootmgr -exfat-utils -fuse2 -fuse3 -fuseiso -gcc -gparted -htop -jdk-openjdk -kitty -libdvdcss -libtool -lsof -lutris -lzop -m4 -make -neofetch -ntfs-3g -ntp -openbsd-netcat -openssh -os-prober -p7zip -papirus-icon-theme -patch -picom -pkgconf -pulseaudio -pulseaudio-alsa -pulseaudio-bluetooth -python-notify2 -python-psutil -python-pyqt5 -python-pip -qemu -snap-pac -snapper -steam -swtpm -synergy -traceroute -ufw -unrar -unzip -virt-manager -virt-viewer -which -wine-gecko -wine-mono -winetricks -zip -zsh -zsh-syntax-highlighting -zsh-autosuggestions diff --git a/pkgs/fonts.txt b/pkgs/fonts.txt deleted file mode 100644 index 005eaaa..0000000 --- a/pkgs/fonts.txt +++ /dev/null @@ -1,13 +0,0 @@ - -awesome-terminal-fonts -noto-fonts -noto-fonts-emoji -powerline-fonts -terminus-font -ttf-dejavu -ttf-droid -ttf-freefont -ttf-hack -ttf-liberation -ttf-roboto -ttf-ubuntu-font-family diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..b03c77c --- /dev/null +++ b/readme.md @@ -0,0 +1,76 @@ +# Archcrystal + +## What the heck? + +A streamlined automated Arch Linux installation script for personal use. +This script automates all the fundamental processes of installing Arch Linux, including disk partitioning, system setup, user setup, and package installation. +It's a fork of the original ArchTitus script, but with significantly less code and fewer user prompts. + +## Motivation + +I enjoy breaking things with Linux (honestly). +Someone once told me that if you eyecandy your Linux env, then you must have a lot of time. +That's why this script automates all the basic requirements for a functional, work-ready environment, tailored to my personal Thinkpad T430 laptop. + +## Perks + +- The script is designed to be as minimal as possible, but functional enough to be used right away. +- The user configuration contains a list of packages by contexts. They have description, read them and be sure of what you're installing. + +## How to use + +- `archcrystal.sh` is the entry point. +- Check the `archcrystal.sh` file to understand the execution order. +- `setup.conf` contains basic environment configuration. + +1. Download an Archlinux iso and run it. +2. Sync pacman & install git using `pacman -Syy git`. +3. Clone archcrystal using `git clone https://github.com/aldochaconc/archcrystal.git`. +4. Grant execute permissions to files with `chmod +x -R ./archcrystal/*`. +5. Run the script using `cd archcrystal` & `./archcrystal.sh`. + +Once the script starts, it will prompt for your password. +This is the only prompt that requires user input. +Later, there are "press to continue" prompts to verify what you are installing. + +## Things kept from the original script: + +- Environment variables management. +- Disk partitioning and disk utilities. +- Mirrorlists and keyring updates. +- Compression settings. +- Graphic drivers auto detection. + +### 0-preinstall.sh + +- Sets up Pacman optimal mirrors. +- Updates keyring. +- Partitions, formats, and mounts the disk. + Installs base packages on the main drive and pacstraps them. +- Generates the fstab file. +- Installs the appropriate bootloader (GRUB or systemd-boot). + +### 1-setup.sh + +Arch-chroot operations + +- Sets up Network, Pacman mirrorlist, and system clock. +- Language, locale, and keymap setup. +- Enables sudo without password for wheel group and multilib in Pacman. +- Installs base system, microcode, graphics, and audio drivers. +- Adds a new user, sets password, and hostname. + +### 2-user.sh + +- Installs YAY AUR helper. +- Defines lists of packages to install by context. +- Declares functions to install packages using pacman and yay. +- Sets ZSH as default shell. +- Installs and configures Oh My ZSH. +- Enables installed services. + +### 3-post-setup.sh + +- Updates grub settings. +- Removes no password sudo rights. +- (Not cleaning due to debugging) diff --git a/scripts/0-preinstall.sh b/scripts/0-preinstall.sh index d635d57..3074063 100755 --- a/scripts/0-preinstall.sh +++ b/scripts/0-preinstall.sh @@ -16,16 +16,16 @@ sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf pacman -S --noconfirm --needed reflector rsync grub cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup echo -ne " -------------------------------------------------------------------------- - Setting up $iso mirrors for faster downloads -------------------------------------------------------------------------- + +Setting up $iso mirrors for faster downloads + " reflector -a 48 -c "$iso" -f 5 -l 20 --sort rate --save /etc/pacman.d/mirrorlist mkdir /mnt &>/dev/null # Hiding error message if any echo -ne " -------------------------------------------------------------------------- - Installing Prerequisites -------------------------------------------------------------------------- + +Installing Prerequisites + " pacman -S --noconfirm --needed gptfdisk btrfs-progs glibc echo -ne " @@ -50,9 +50,9 @@ partprobe ${DISK} # reread partition table to ensure it is correct # make filesystems echo -ne " -------------------------------------------------------------------------- - Creating Filesystems -------------------------------------------------------------------------- + +Creating Filesystems + " # @description Creates the btrfs subvolumes. createsubvolumes() { @@ -110,11 +110,11 @@ if ! grep -qs '/mnt' /proc/mounts; then reboot now fi echo -ne " -------------------------------------------------------------------------- - Arch Install on Main Drive -------------------------------------------------------------------------- + +Arch Install on Main Drive + " -pacstrap /mnt base base-devel linux linux-firmware vim sudo archlinux-keyring wget libnewt --noconfirm --needed +pacstrap /mnt base base-devel linux linux-firmware linux-headers vim sudo archlinux-keyring wget libnewt --noconfirm --needed cp -R ${BASE_DIR} /mnt/root/archcrystal cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist diff --git a/scripts/1-setup.sh b/scripts/1-setup.sh index fad01a7..374495b 100755 --- a/scripts/1-setup.sh +++ b/scripts/1-setup.sh @@ -1,23 +1,23 @@ #!/usr/bin/env bash echo -ne " -------------------------------------------------------------------------- + Automated Arch Linux Installer SCRIPTHOME: archcrystal -------------------------------------------------------------------------- + " source $HOME/archcrystal/setup.conf echo -ne " -------------------------------------------------------------------------- - Network Setup -------------------------------------------------------------------------- + +Network Setup + " pacman -S --noconfirm --needed networkmanager dhclient systemctl enable NetworkManager echo -ne " -------------------------------------------------------------------------- - Setting up mirrors for optimal download -------------------------------------------------------------------------- + +Setting up Pacman mirrors for optimal download + " pacman -S --noconfirm --needed pacman-contrib curl pacman -S --noconfirm --needed reflector rsync grub arch-install-scripts git @@ -25,11 +25,11 @@ cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak nc=$(grep -c ^processor /proc/cpuinfo) echo -ne " -------------------------------------------------------------------------- - You have " $nc" cores. And - changing the makeflags for "$nc" cores. Aswell as - changing the compression settings. -------------------------------------------------------------------------- + +You have " $nc" cores. And +changing the makeflags for "$nc" cores. +Aswell as changing the compression settings. + " TOTAL_MEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') if [[ $TOTAL_MEM -gt 8000000 ]]; then @@ -37,9 +37,9 @@ if [[ $TOTAL_MEM -gt 8000000 ]]; then sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g" /etc/makepkg.conf fi echo -ne " -------------------------------------------------------------------------- - Setup Language to US and set locale -------------------------------------------------------------------------- + +Setup Language and set locale + " sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen locale-gen @@ -62,18 +62,16 @@ sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf pacman -Sy --noconfirm --needed echo -ne " -------------------------------------------------------------------------- - Installing Base System -------------------------------------------------------------------------- -" -sudo pacman -S --noconfirm --needed \ - mesa xorg ibus man-db vim neovim wifi-menu dialog +Installing Base System +" + +sudo pacman -S --noconfirm --needed mesa xorg ibus man-db vim wifi-menu dialog echo -ne " -------------------------------------------------------------------------- - Installing Microcode -------------------------------------------------------------------------- + +Installing Microcode + " # determine processor type and install microcode proc_type=$(lscpu) @@ -88,12 +86,13 @@ elif grep -E "AuthenticAMD" <<<${proc_type}; then fi echo -ne " -------------------------------------------------------------------------- - Installing Graphics Drivers -------------------------------------------------------------------------- + +Installing Graphics Drivers + " # Graphics Drivers find and install gpu_type=$(lspci) +echo "GPU Type: ${gpu_type}" if grep -E "NVIDIA|GeForce" <<<${gpu_type}; then pacman -S --noconfirm --needed nvidia nvidia-xconfig @@ -108,9 +107,9 @@ elif grep -E "Intel Corporation UHD" <<<${gpu_type}; then fi echo -ne " -------------------------------------------------------------------------- - Installing Audio Drivers -------------------------------------------------------------------------- + +Installing Audio Drivers + " pacman -S --noconfirm --needed \ alsa-utils alsa-plugins pulseaudio pulseaudio-alsa pulseaudio-bluetooth \ @@ -153,9 +152,9 @@ if ! source $HOME/archcrystal/setup.conf; then echo "NAME_OF_MACHINE=${name_of_machine,,}" >>${HOME}/archcrystal/setup.conf fi echo -ne " -------------------------------------------------------------------------- - Adding User -------------------------------------------------------------------------- + +Adding User + " if [ $(whoami) = "root" ]; then groupadd libvirt @@ -176,7 +175,8 @@ else echo "You are already a user proceed with aur installs" fi echo -ne " -------------------------------------------------------------------------- - SYSTEM READY FOR 2-user.sh -------------------------------------------------------------------------- + +SYSTEM READY FOR 2-user.sh + " +read -p "Press enter to continue" diff --git a/scripts/2-user.sh b/scripts/2-user.sh index e29f48e..3bb3ec9 100755 --- a/scripts/2-user.sh +++ b/scripts/2-user.sh @@ -8,17 +8,17 @@ source $HOME/archcrystal/setup.conf export PATH=$PATH:~/.local/bin echo -ne " - Installing AUR Helper +Installing AUR Helper " -# cd ~ -# git clone "https://aur.archlinux.org/yay.git" -# cd ~/yay -# makepkg -si --noconfirm -# cd ~ +cd ~ +git clone "https://aur.archlinux.org/yay.git" +cd ~/yay +makepkg -si --noconfirm +cd ~ declare -A powerManagement=( - ["thermald"]="Thermal daemon for preventing overheating" - ["acpid"]="Advanced Configuration and Power Interface event daemon" + ["thermald"]="Daemon to prevent cpu overheating" + ["acpid"]="Daemon to dispatch ACPI events" ) # Provide compat pkgs for iOS and windows. Also libs such as python-psutil, required in a lot of pkgs @@ -27,7 +27,7 @@ declare -A compatibility=( ["ifuse"]="A fuse filesystem to access the contents of iOS devices" ["libimobiledevice"]="A cross-platform librariesand tools for iOS" ["libtool"]="A generic library support script" - ["ntfs-3g"]="NTFS filesystem driver and utilities" + ["ntfs-3g"]="NTFS filesystem driver and utilities (windows compat)" ["ntp"]="Network Time Protocol" ["os-prober"]="For detecting other operative system such as Windows" ["python-pip"]="The PyPA recommended tool for installing Python packages" @@ -36,64 +36,64 @@ declare -A compatibility=( # Provide user utils for auth, keyring, monitor, compression declare -A utilities=( - ["tree"]="A directory listing program displaying a depth indented list of files" - ["gparted"]="A partition editor for graphically managing your disk partitions" + ["tree"]="Show directory structures in cli" + ["gparted"]="Manage disks" ["powerline"]="Statusline plugin for vim" - ["htop"]="Interactive process viewer" - ["p7zip"]="Command-line file archiver with high compression ratio" - ["neofetch"]="A fast, highly customizable system info script" - ["ncdu"]="A disk usage analyzer with a ncurses interface" + ["htop"]="CLI process administrator" + ["p7zip"]="Compression tool" + ["neofetch"]="i use arch btw" + ["ncdu"]="disk usage cli" ) declare -A pacmanFonts=( ["adobe-source-han-sans-otc-fonts"]="Adobe fonts for CN, KR, JP compat" ["adobe-source-han-serif-otc-fonts"]="Adobe fonts for CN, KR, JP compat" - ["otf-montserrat"]="Geometric sans-serif typeface" - ["ttf-fira-mono"]="Monospaced font with programming ligatures" - ["ttf-fira-sans"]="Geometric sans-serif typeface" - ["ttf-font-awesome"]="Iconic font designed for use with Twitter Bootstrap" + # ["otf-montserrat"]="Geometric sans-serif typeface" + # ["ttf-fira-mono"]="Monospaced font with programming ligatures" + # ["ttf-fira-sans"]="Geometric sans-serif typeface" + ["ttf-font-awesome"]="Dependency for powerline" ["ttf-roboto-mono"]="Monospaced font family for user interface and coding environments" ) declare -A yayFonts=( ["powerline-fonts"]="Fonts for the powerline statusline plugin" ["ttf-font-icons"]="A set of icons and symbols for TTF fonts" + ["nerd-fonts"]="Required for zsh and oh-my-zsh" # ["ttf-google-fonts-git"]="Google Fonts packaged for Arch Linux" # ["ttf-ionicons"]="The premium icon font for Ionic Framework" ) declare -A desktopEnv=( - ["arandr"]="A simple visual front end for XRandR" - ["autorandr"]="Auto-detect screens and update layouts" - ["dunst"]="Customizable and lightweight notification-daemon" - ["gnome-keyring"]="Stores passwords and encryption keys" - ["i3"]="An improved dynamic tiling window manager" - ["i3status"]="Status bar for i3" - ["nautilus"]="GNOME file manager" - ["notification-daemon"]="Notification daemon for the desktop notifications" - ["pavucontrol"]="PulseAudio Volume Control" - ["polkit-gnome"]="GNOME frontend to the PolicyKit framework" - ["rofi"]="A window switcher, application launcher and dmenu replacement" + ["arandr"]="Manage screen layouts" + ["autorandr"]="Autorefresh screen layouts" + ["dunst"]="Notification daemon" + ["secret-tool"]="Allow apps use gnome-keyring" + ["i3"]="Tiling manager" + ["i3status"]="i3 dependency (bar)" + ["gnome-keyring"]="GNOME keyring for psw management" + ["rofi"]="App launcher" + ["xdg-user-dirs"]="Setup default dirs" + ["nautilus"]="GNOME file explorer" + ["pavucontrol"]="GNOME GUI Volume Control" + ["polkit-gnome"]="GNOME auth agent (dependency for gui apps)" ["seahorse"]="GNOME application for managing PGP keys" - ["xdg-user-dirs"]="Tool to help manage well known user directories" ) declare -A apps=( ["chromium"]="A web browser built for speed, simplicity, and security" - ["discord"]="All-in-one voice and text chat" + # ["discord"]="All-in-one voice and text chat" ) declare -A yayApps=( ["lightscreen"]="A simple tool to automate screenshots" ) declare -A devEnv=( - ["git"]="A distributed version control system" - ["neovim"]="Vi Improved, a highly configurable, improved version of the vi text editor" - ["nodejs"]="Evented I/O for V8 javascript" - ["npm"]="A package manager for javascript" - ["rxvt-unicode"]="A customizable terminal emulator" - ["zsh"]="A very advanced and programmable command interpreter (shell) for UNIX" + ["git"]="versioning" + ["neovim"]="vim fork" + ["nodejs"]="the best" + ["rxvt-unicode"]="terminal emulator" + ["zsh"]="shell" ) installPacmanPackages() { @@ -146,18 +146,16 @@ installYayPackages yayFonts "Yay Fonts" installYayPackages yayApps "Yay Apps" echo "Setting up ZSH as default shell" +RUNZSH=no sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" chsh -s /bin/zsh -sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" - echo "Enabling services" sudo systemctl enable thermald sudo systemctl enable acpid -sudo systemctl enable power-profiles-daemon sudo systemctl enable NetworkManager sudo systemctl enable sshd sudo systemctl enable ntpd -sudo systemctl enable ufw +sudo systemctl enable bluetooth echo -ne " ------------------------------------------------------------------------- diff --git a/scripts/3-post-setup.sh b/scripts/3-post-setup.sh index 5b36bd3..c3f621f 100755 --- a/scripts/3-post-setup.sh +++ b/scripts/3-post-setup.sh @@ -1,12 +1,10 @@ #!/usr/bin/env bash echo -ne " -------------------------------------------------------------------------- - SCRIPTHOME: ArchCrystal -------------------------------------------------------------------------- Final Setup and -SConfigurations GRUB EFI Bootloader Install & Check + " source ${HOME}/archcrystal/setup.conf @@ -15,34 +13,18 @@ if [[ -d "/sys/firmware/efi" ]]; then fi echo -ne " -------------------------------------------------------------------------- - Creating (and Theming) Grub Boot Menu -------------------------------------------------------------------------- + +Creating (and Theming) Grub Boot Menu + " echo -e "Updating grub..." grub-mkconfig -o /boot/grub/grub.cfg echo -e "All set!" echo -ne " -------------------------------------------------------------------------- - Enabling Essential Services -------------------------------------------------------------------------- -" -systemctl enable ntpd.service -echo " NTP enabled" -systemctl disable dhcpcd.service -echo " DHCP disabled" -systemctl stop dhcpcd.service -echo " DHCP stopped" -systemctl enable NetworkManager.service -echo " NetworkManager enabled" -systemctl enable bluetooth -echo " Bluetooth enabled" -echo -ne " -------------------------------------------------------------------------- - Cleaning -------------------------------------------------------------------------- +Cleaning + " # Remove no password sudo rights sed -i 's/^%wheel ALL=(ALL) NOPASSWD: ALL/# %wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers