Commit cdfb12c

Ansari <ping@ansari.wtf>
2025-12-30 19:44:51
enhance installation scripts: add zsh to base system and expand post-install setup with media, session, and dotfile configurations
1 parent 205bb06
Changed files (2)
arch/install.sh
@@ -128,7 +128,7 @@ install_base_system(){
     echo
     log_info "Installing base system packages"
     log_warning "About to install base system packages. This may take a while."
-    execute_step "pacstrap -K /mnt base base-devel linux linux-headers linux-firmware btrfs-progs vim openssh networkmanager sudo git" "Installing base system packages"
+    execute_step "pacstrap -K /mnt base base-devel linux linux-headers linux-firmware btrfs-progs neovim openssh networkmanager sudo git zsh" "Installing base system packages"
     clear_screen_from_given_line 25
     log_success "Base system packages installed successfully."
 }
arch/post-install.sh
@@ -6,6 +6,127 @@ sudo -v
 ( while true; do sudo -n true; sleep 60; done ) & 
 sudo_keepalive_pid=$!
 
+PRE_INSTALLED_PKGS=(
+    base
+    base-devel
+    linux
+    linux-firmware
+    linux-headers
+    btrfs-progs
+    sudo
+    openssh
+    neovim
+    git
+    networkmanager
+    zsh
+    
+    # NVIDIA Drivers
+    dkms
+    libva-nvidia-driver
+    nvidia-open-dkms
+)
+
+
+HYPRLAND_STACK=(
+    hyprland-git
+    hypridle-git
+    hyprlock-git
+    hyprpicker-git
+    hyprshot
+    xdg-desktop-portal-hyprland-git
+    swww
+    waybar
+    cliphist
+    rofi
+    rofi-calc
+    rofimoji
+    wtype # rofimoji dependency
+)
+
+FONTS_THEME=(
+    noto-fonts
+    noto-fonts-emoji
+    ttf-hack-nerd
+    woff2-font-awesome
+    nwg-look
+)
+
+CLI_TOOLS=(
+    bat
+    btop
+    cpio
+    dust
+    ddcutil
+    eza
+    fd
+    fzf
+    fastfetch
+    ripgrep
+    tree
+    tmux
+    zoxide
+    stow
+    gum
+    pacman-contrib
+    python-setuptools
+    unzip
+    xdg-terminal-exec
+)
+
+CONTAINERS_VMS=(
+    docker
+    docker-buildx
+    docker-compose
+    lazydocker
+)
+
+NETWORK_REMOTE=(
+    networkmanager
+    openssh
+    tailscale
+    #   rustdesk-bin
+    #   tigervnc
+    localsend
+    dnsmasq
+)
+
+GUI_APPS=(
+    ghostty
+    chromium
+    discord
+    evince
+    thunar
+    visual-studio-code-bin
+    zen-browser-bin
+    obsidian-bin
+    bambustudio-bin
+    bruno-bin
+)
+
+SECURITY=(
+    ufw
+    ufw-docker
+    polkit-gnome
+    keychain
+)
+
+SESSION_STACK=(
+    sddm
+    uwsm
+    xorg-xhost
+#   sddm dependencies
+    qt6-svg
+    qt6-multimedia-ffmpeg
+)
+
+MEDIA_STACK=(
+    pipewire-pulse
+    wireplumber
+    pavucontrol
+    mpv
+    imv
+)
+
 cleanup_sudo() {
     kill "$sudo_keepalive_pid"
 }
@@ -31,7 +152,7 @@ cleanup(){
     exit 1
 }
 
-yay_install(){
+yay_setup(){
     if ! yay --version >/dev/null 2>&1; then
         execute_step "git --version" "Precheck Git installed"
         execute_step "git clone https://aur.archlinux.org/yay.git" "Cloning yay from git"
@@ -45,24 +166,67 @@ yay_install(){
 }
 
 
+media_setup(){
+    log_info "Setting up Media Applications"
+    execute_step "sudo pacman -S --needed ${MEDIA_STACK[@]}" "Installing Media Stack Packages"
+    log_info "Media Applications setup completed"
+
+    log_info "Setting up audio with PipeWire"
+    execute_step "systemctl --user enable pipewire pipewire-pulse wireplumber" "Enabling PipeWire, PipeWire-Pulse, and WirePlumber services"
+    execute_step "systemctl --user start pipewire pipewire-pulse wireplumber" "Starting PipeWire, PipeWire-Pulse, and WirePlumber services"
+    execute_step "systemctl --user restart pipewire pipewire-pulse wireplumber" "Restarting PipeWire services to ensure they are running"
+    log_info "Audio setup completed"
+}
+
+session_setup(){
+    log_info "Setting up Session Manager (SDDM)"
+    execute_step "sudo pacman -S --needed ${SESSION_STACK[@]}" "Installing Session Stack Packages"
+    execute_step "git clone -b wraith https://github.com/The-Robin-Hood/SilentSDDM" "Cloning Wraith SDDM"
+    execute_step "sudo mkdir -p /usr/share/sddm/themes/wraith" "Creating SDDM folder"
+    execute_step "sudo cp -r SilentSDDM/* /usr/share/sddm/themes/wraith/" "Moving files"
+    if [[ -f /etc/sddm.conf ]]; then
+        sudo cp -f /etc/sddm.conf /etc/sddm.conf.bk
+        sudo rm -rf /etc/sddm.conf
+    fi
+    execute_step "echo -e '[Theme]\nCurrent=wraith\nGreeterEnvironment=QML2_IMPORT_PATH=/usr/share/sddm/themes/wraith/components/' | sudo tee -a /etc/sddm.conf" "Editing /etc/sddm.conf" 
+    execute_step "sudo cp '$HOME/.assets/imgs/dp.jpg' '/usr/share/sddm/faces/$USERNAME.face.icon'" "Setting Avatar for the user"
+    log_info "Done with sddm setup"
+}
+
+dotfile_setup(){
+    log_info "Setting up Dotfiles and Oh-My-Zsh"
+    execute_step 'sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"' "Installing oh-my-zsh"
+    execute_step "git clone https://github.com/zsh-users/zsh-autosuggestions .oh-my-zsh/custom/plugins/zsh-autosuggestions" "Cloning zsh-autosuggestions plugin"
+    execute_step "git clone https://github.com/The-Robin-Hood/dotfiles" "Cloning Dotfiles"
+    execute_step "cd dotfiles && stow . --adopt && git restore . && cd .." "Configuring dotfiles"
+    log_info "Dotfiles and Oh-My-Zsh setup completed"   
+}
+
+
+
+
 main(){
     clear
     ensure_connectivity_and_source
     setup_cleanup_trap cleanup  
     trap cleanup_sudo EXIT
     show_box "Arch Post Installation" 
-    yay_install
-    execute_step "yay -S --noconfirm fzf fd tree stow keychain zsh unzip ghostty tmux zoxide neovim cliphist pacman-contrib --needed" "Installing Development Essentials"
-    execute_step "yay -S --noconfirm rofi bat polkit-gnome ttf-font-awesome noto-fonts noto-fonts-emoji --needed" "Installing Minimal GUI Tools"
-    execute_step "yay -S --noconfirm bruno-bin obsidian-bin visual-studio-code-bin zen-browser-bin" "Installing Prebuild binaries"
-    execute_step "yay -S --noconfirm hyprland-git" "Installing Hyprland"
-    # execute_step "yay -S --noconfirm hypridle hyprlock-git hyprshot ags-hyprpanel-git swww --needed" "Installing Hyprland Environment"
-    execute_step 'sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"' "Installing oh-my-zsh"
-    execute_step "git clone https://github.com/zsh-users/zsh-autosuggestions .oh-my-zsh/custom/plugins/zsh-autosuggestions" "Cloning zsh-autosuggestions plugin"
-    execute_step "git clone https://github.com/The-Robin-Hood/dotfiles" "Cloning Dotfiles"
-    execute_step "cd dotfiles && stow . --adopt && git restore . && cd .." "Configuring dotfiles"
-    # execute_step "swww img .assets/wallpapers/gwen-stacy.jpg --transition-fps=60 --transition-type=wipe" "Configuring Wallpaper" 
-}
+    
+    yay_setup
+    
+    execute_step "yay -Syu --noconfirm" "Updating System Packages"
+    execute_step "yay -S --noconfirm ${PRE_INSTALLED_PKGS[@]}" "Checking Pre-installed Packages"
+    execute_step "yay -S --noconfirm ${FONTS_THEME[@]}" "Installing Fonts and Theme Packages"
+    execute_step "yay -S --noconfirm ${SECURITY[@]}" "Installing Security Packages"
+    execute_step "yay -S --noconfirm ${CLI_TOOLS[@]}" "Installing CLI Tools"
+    execute_step "yay -S --noconfirm ${NETWORK_REMOTE[@]}" "Installing Network and Remote Packages"
+    execute_step "yay -S --noconfirm ${CONTAINERS_VMS[@]}" "Installing Container and VM Packages"
+    execute_step "yay -S --noconfirm ${GUI_APPS[@]}" "Installing GUI Applications"
+    execute_step "yay -S --noconfirm ${HYPRLAND_STACK[@]}" "Installing Hyprland and related Packages"
 
-main
+    media_setup
+    session_setup
+    dotfile_setup
 
+    execute_step "swww img .assets/wallpapers/gwen-stacy.jpg --transition-fps=60 --transition-type=wipe" "Configuring Wallpaper" 
+}