Skip to content

Instantly share code, notes, and snippets.

@PhoenixAceVFX
Last active March 6, 2025 18:29
Show Gist options
  • Save PhoenixAceVFX/006aac638964764af7d070bfee9aa01e to your computer and use it in GitHub Desktop.
Save PhoenixAceVFX/006aac638964764af7d070bfee9aa01e to your computer and use it in GitHub Desktop.
Command string to FULLY rebuild all of hyprland to hopefully fix anything
#!/bin/bash
# Function to detect package manager
detect_package_manager() {
if command -v paru &>/dev/null; then
echo "paru"
elif command -v yay &>/dev/null; then
echo "yay"
elif command -v pacman &>/dev/null; then
echo "pacman"
elif command -v apt &>/dev/null; then
echo "apt"
elif command -v dnf &>/dev/null; then
echo "dnf"
else
echo "unknown"
fi
}
# Get the package manager
PKG_MANAGER=$(detect_package_manager)
case "$PKG_MANAGER" in
"paru"|"yay")
# For Arch-based systems with AUR helpers
pacman -Qq | grep -E "(hypr|aqua)" | grep -- -git | grep -v -- -debug | $PKG_MANAGER -Syu --rebuild --noconfirm -
;;
"pacman")
# For vanilla Arch Linux
pacman -Qq | grep -E "(hypr|aqua)" | grep -- -git | grep -v -- -debug | sudo pacman -Syu --noconfirm -
;;
"apt")
# For Debian-based systems
dpkg -l | grep -E "(hypr|aqua)" | awk '{print $2}' | xargs sudo apt update && sudo apt install -y
;;
"dnf")
# For Fedora-based systems
dnf list installed | grep -E "(hypr|aqua)" | awk '{print $1}' | xargs sudo dnf update -y
;;
*)
echo "Unsupported package manager. Please manually update your Hyprland packages."
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment