mirror of
https://github.com/theupriser/steamify-cachyos.git
synced 2026-10-03 17:41:58 +02:00
- Fix session switching: sync bridge only edits [Autologin], sync service no longer hits systemd's start limit, re-runs don't duplicate settings - Make the Return to Gaming Mode shortcut work without a password prompt - Steam desktop autostart only runs in Plasma, not inside gamescope - Vapor theme: fix install path, wallpaper, icon and color scheme; take over Valve's SteamOS defaults, GTK theme, panel layout and dark mode; always fetch the newest steamdeck-kde-presets with checksum verification - Steam Machine: install kernel headers and build/load the leds-valve driver reliably; ask before installing OpenRGB - Split the script into lib/ modules per responsibility - Rewrite README for end users with a technical details section; add AGENTS.md
84 lines
2.8 KiB
Bash
84 lines
2.8 KiB
Bash
#!/bin/bash
|
|
# Required packages and AUR helper handling.
|
|
# Sourced by setup-gamescope-boot.sh; not meant to be run on its own.
|
|
|
|
aur_noninteractive_flags() {
|
|
# Fully non-interactive install flags for the given AUR helper: no
|
|
# PKGBUILD diff/edit/cleanbuild prompts, no provider-selection prompts
|
|
# (e.g. picking kernel headers for DKMS), and makepkg itself silenced.
|
|
case "$1" in
|
|
yay)
|
|
echo --needed --noconfirm --answerclean None --answerdiff None \
|
|
--answeredit None --mflags "--noconfirm"
|
|
;;
|
|
paru)
|
|
echo --needed --noconfirm --skipreview --mflags "--noconfirm"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
find_aur_helper() {
|
|
if command -v yay >/dev/null 2>&1; then
|
|
echo yay
|
|
elif command -v paru >/dev/null 2>&1; then
|
|
echo paru
|
|
fi
|
|
}
|
|
|
|
bootstrap_yay() {
|
|
# Builds and installs yay from the AUR using only makepkg + base-devel
|
|
# (both from the official repos), so we have an AUR helper available
|
|
# without assuming the user already set one up.
|
|
info "Installing base-devel and git (needed to build an AUR helper)..."
|
|
sudo pacman -S --needed --noconfirm base-devel git || return 1
|
|
|
|
local tmp_dir
|
|
tmp_dir="$(mktemp -d)"
|
|
info "Cloning yay-bin from the AUR..."
|
|
if ! git clone --depth 1 https://aur.archlinux.org/yay-bin.git "$tmp_dir/yay-bin"; then
|
|
err "Failed to clone yay-bin from the AUR."
|
|
rm -rf "$tmp_dir"
|
|
return 1
|
|
fi
|
|
|
|
info "Building and installing yay (this runs makepkg as your user, not root)..."
|
|
if (cd "$tmp_dir/yay-bin" && makepkg -si --noconfirm); then
|
|
ok "yay installed."
|
|
rm -rf "$tmp_dir"
|
|
return 0
|
|
else
|
|
err "Building yay failed. See errors above."
|
|
rm -rf "$tmp_dir"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
install_required_packages() {
|
|
# Step 2: gamescope/Steam and the desktop helpers the rest of the setup uses.
|
|
local -a MISSING
|
|
info "Checking required packages: gamescope-session-cachyos, steam, mangohud, xterm, ttf-liberation, wqy-zenhei, plasma-keyboard"
|
|
mapfile -t MISSING < <(pacman -T gamescope-session-cachyos steam mangohud xterm ttf-liberation wqy-zenhei plasma-keyboard)
|
|
|
|
if [[ ${#MISSING[@]} -gt 0 ]]; then
|
|
info "Missing packages: ${MISSING[*]}"
|
|
if ask_yn "Install them now?"; then
|
|
sudo pacman -S --needed --noconfirm "${MISSING[@]}" || { err "Package installation failed."; exit 1; }
|
|
else
|
|
err "Cannot continue without these packages."
|
|
exit 1
|
|
fi
|
|
else
|
|
ok "All required packages already installed."
|
|
fi
|
|
}
|
|
|
|
ensure_aur_helper() {
|
|
# yay or paru, bootstrapping yay from the AUR when neither is installed.
|
|
if [[ -n "$(find_aur_helper)" ]]; then
|
|
ok "AUR helper already present."
|
|
else
|
|
info "No AUR helper (yay/paru) found. Installing yay..."
|
|
bootstrap_yay
|
|
fi
|
|
}
|