Last active
June 10, 2025 06:37
-
-
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 | |
# Arch Linux Post-Installation Script for Wayland | |
# Author: Speyll | |
# Last update: 20-03-2025 | |
set -e # Exit on error | |
# Update system | |
sudo pacman -Syu --noconfirm | |
# Install gpu drivers | |
install_gpu_driver() { | |
gpu_driver="" | |
case "$(lspci | grep -E 'VGA|3D')" in | |
*Intel*) gpu_driver="mesa vulkan-intel intel-media-driver libva-intel-driver libva-mesa-driver" ;; | |
*AMD*) gpu_driver="mesa vulkan-radeon xf86-video-amdgpu libva-mesa-driver" ;; | |
*NVIDIA*)gpu_driver="nvidia nvidia-utils lib32-nvidia-utils nvidia-settings" ;; | |
esac | |
for pkg in $gpu_driver; do | |
[ -n "$pkg" ] && sudo pacman -S --noconfirm "$pkg" | |
done | |
} | |
install_core_packages() { | |
for pkg in git tmux wayland dbus curl base-devel dash \ | |
xdg-utils xdg-desktop-portal-gtk xdg-desktop-portal-gnome xdg-desktop-portal-wlr xdg-desktop-portal \ | |
pipewire gst-plugin-pipewire rtkit pavucontrol wlr-randr \ | |
noto-fonts-emoji noto-fonts-cjk noto-fonts ttf-nerd-fonts-symbols \ | |
grim slurp wl-clipboard cliphist \ | |
swayimg imv swaybg mpv ffmpeg yt-dlp \ | |
libnotify \ | |
yazi unzip p7zip unrar xz pcmanfm-qt ffmpegthumbnailer webp-pixbuf-loader tumbler gvfs-smb gvfs-afc gvfs-mtp udisks2 \ | |
breeze-gtk breeze-icons \ | |
qt5ct qt6ct bluez \ | |
labwc neovim foot waybar wlsunset fuzzel brightnessctl bash-completion \ | |
networkmanager wireguard-tools; do | |
sudo pacman -S --noconfirm "$pkg" || echo "Failed to install $pkg" | |
done | |
} | |
install_paru() { | |
git clone https://aur.archlinux.org/paru-bin.git | |
pushd paru-bin | |
makepkg -si --noconfirm | |
popd | |
rm -rf paru-bin | |
} | |
install_paru_packages() { | |
packages=(wvkbd mpvpaper flavours) | |
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 | |
} | |
# Install everything | |
install_core_packages | |
install_paru | |
install_paru_packages | |
install_flatpak_packages | |
#install_flatpak_gaming | |
# Enable services | |
sudo systemctl enable bluetooth.service | |
sudo systemctl enable polkit.service | |
sudo systemctl enable rtkit-daemon.service | |
sudo systemctl enable NetworkManager.service | |
# Use dash as /bin/sh | |
sudo ln -sfT /usr/bin/dash /bin/sh | |
# Clone and set up dotfiles | |
git clone https://github.com/speyll/dotfiles "$HOME/dotfiles" | |
cp -r "$HOME/dotfiles/."* "$HOME/" | |
rm -rf "$HOME/dotfiles" | |
# Permissions and setup | |
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 install scripts (assumes dash) | |
dash "$HOME/.local/share/fonts/git-fonts.sh" | |
dash "$HOME/.local/share/icons/git-cursors.sh" | |
# Sudoers rule for shutdown etc. | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment