Last active
May 20, 2026 20:16
-
-
Save Speyll/ecad8917d5af6a15e929634ac6523aca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Optimized CachyOS Post-Installation Script for AMD/Wayland (Niri) | |
| # Author: Speyll | |
| set -e # Exit on error | |
| # 1. Force Ultimate Parallel Network Optimization | |
| echo "Optimizing pacman configurations..." | |
| sudo sed -i 's/^#ParallelDownloads = .*/ParallelDownloads = 10/' /etc/pacman.conf | |
| # Fully sync databases | |
| sudo pacman -Syu --noconfirm | |
| # 2. Hardened AMD Driver Installation (Including 32-bit Vulkan for gaming) | |
| install_gpu_driver() { | |
| echo "Checking hardware and deploying graphics stack..." | |
| case "$(lspci | grep -E 'VGA|3D')" in | |
| *AMD*) | |
| sudo pacman -S --noconfirm mesa vulkan-radeon xf86-video-amdgpu libva-mesa-driver lib32-mesa lib32-vulkan-radeon opencl-mesa lib32-opencl-mesa amd-ucode | |
| ;; | |
| *Intel*) | |
| sudo pacman -S --noconfirm mesa vulkan-intel intel-media-driver libva-intel-driver libva-mesa-driver | |
| ;; | |
| *NVIDIA*) | |
| sudo pacman -S --noconfirm nvidia nvidia-utils lib32-nvidia-utils nvidia-settings | |
| ;; | |
| esac | |
| } | |
| # 3. System Core & Performance Optimizations Bulk List | |
| install_core_packages() { | |
| packages=( | |
| # Development, Shell & Microcode Core | |
| git tmux base-devel dash curl dbus bash-completion libnotify fzf | |
| # Performance Backends & Realtime | |
| rtkit bpftune-git profile-sync-daemon corectrl cpupower | |
| # Wayland Core & Display Server Bridge | |
| wayland xorg-xwayland xwayland-satellite xdg-utils | |
| xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-desktop-portal | |
| # PipeWire Audio Infrastructure | |
| pipewire pipewire-alsa pipewire-pulse gst-plugin-pipewire wireplumber | |
| # Niri Environment & Command-Line Layout Tools | |
| niri neovim alacritty wlsunset brightnessctl wlr-randr wl-clipboard cliphist hyprlock hypridle mako fuzzel | |
| # Fonts | |
| noto-fonts-emoji noto-fonts-cjk noto-fonts ttf-nerd-fonts-symbols | |
| # Lower-Level System/Archive Utilities | |
| unzip p7zip unrar xz networkmanager wireguard-tools udisks2 openrgb fuse2 fwupd | |
| pcmanfm-qt ffmpegthumbnailer totem webp-pixbuf-loader tumbler gvfs-smb gvfs-afc gvfs-mtp | |
| # System Themes & Security Backends | |
| breeze-gtk breeze-icons qt5ct bluez polkit-gnome seahorse gnome-keyring | |
| ) | |
| echo "Deploying system packages via parallel downloads..." | |
| sudo pacman -S --noconfirm "${packages[@]}" | |
| } | |
| # 4. AUR Packages | |
| install_paru() { | |
| if ! command -v paru &> /dev/null; then | |
| echo "Bootstrapping Paru AUR helper..." | |
| git clone https://aur.archlinux.org/paru-bin.git | |
| pushd paru-bin | |
| makepkg -si --noconfirm | |
| popd | |
| rm -rf paru-bin | |
| fi | |
| } | |
| install_paru_packages() { | |
| # Added xone-dkms for Xbox controllers & linux-cachyos-headers for module building | |
| packages=( | |
| mpvpaper flavours qt6ct-kde #obs-wlroots-screencopy-git | |
| ) | |
| echo "Deploying AUR specific binaries..." | |
| paru -Syu --noconfirm "${packages[@]}" | |
| } | |
| install_flatpak_packages() { | |
| sudo pacman -S --noconfirm flatpak | |
| flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo | |
| flatpak install flathub io.gitlab.librewolf-community -y | |
| flatpak install flathub com.github.tchx84.Flatseal -y | |
| } | |
| install_flatpak_gaming() { | |
| flatpak install flathub com.usebottles.bottles -y | |
| flatpak install flathub org.freedesktop.Platform.VulkanLayer.MangoHud -y | |
| flatpak install flathub org.freedesktop.Platform.VulkanLayer.gamescope -y | |
| flatpak install flathub com.valvesoftware.Steam.CompatibilityTool.Proton-GE -y | |
| flatpak install flathub com.obsproject.Studio.Plugin.OBSVkCapture -y | |
| flatpak install flathub org.freedesktop.Platform.VulkanLayer.OBSVkCapture -y | |
| } | |
| # --- Execution --- | |
| install_gpu_driver | |
| install_core_packages | |
| install_paru | |
| install_paru_packages | |
| #install_flatpak_packages | |
| #install_flatpak_gaming | |
| # 5. System Daemon Initialization | |
| sudo systemctl enable bluetooth.service | |
| sudo systemctl enable rtkit-daemon.service | |
| sudo systemctl enable NetworkManager.service | |
| # Enable Profile Sync Daemon for instant web-browsing speedups | |
| systemctl --user enable psd.service | |
| # Enable User Audio Stack | |
| systemctl --user enable pipewire.service wireplumber.service pipewire-pulse.service | |
| # 6. User Space Setup & Dotfiles Environment | |
| if [ ! -d "$HOME/dotfiles" ]; then | |
| git clone https://github.com/speyll/dotfiles "$HOME/dotfiles" | |
| cp -r "$HOME/dotfiles/." "$HOME/" | |
| rm -rf "$HOME/dotfiles" | |
| fi | |
| # Apply absolute dynamic permissions path layout | |
| chmod -R a+rx "$HOME/.local/bin" | |
| chmod -R a+rx "$HOME/.local/share/applications" | |
| chmod -R a+rx "$HOME/.config/autostart" | |
| ln -sf "$HOME/.config/mimeapps.list" "$HOME/.local/share/applications/" | |
| # Font and cursor tracking scripts (Handled under dash environment safely) | |
| dash "$HOME/.local/share/fonts/git-fonts.sh" | |
| dash "$HOME/.local/share/icons/git-cursors.sh" | |
| # 7. Elevation Permissions Overhaul (Passwordless system hooks) | |
| echo "%wheel ALL=(ALL:ALL) NOPASSWD: /usr/bin/halt, /usr/bin/poweroff, /usr/bin/reboot, /usr/bin/shutdown, /usr/bin/zzz, /usr/bin/ZZZ" \ | |
| | sudo tee /etc/sudoers.d/wheel > /dev/null | |
| echo "Initialization success. Complete live mirror of your workstation configuration is deployable." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment