Many hotfixes...

This commit is contained in:
2026-04-12 09:21:02 -04:00
parent 8977777ef5
commit 49832a989f
Executable → Regular
+29 -17
View File
@@ -31,6 +31,8 @@ RED="\e[31m"
GREEN="\e[32m"
ERASE='\033[0m'
USERNAME=$(logname)
run_unprivileged() {
sudo -u "$USERNAME" "$@"
}
@@ -44,10 +46,11 @@ is_installed() {
assert() {
if ! $1; then
echo "Script depends on $2 to function, please resolve manually."
exit 1
fi
# Yes, this is always true, but anyway.
return $1
return 0
}
# Credit to NaN on StackOverflow for this solution.
@@ -78,6 +81,29 @@ if [[ $(id -u) > 0 ]]; then
exit 1
fi
# Needs to be this funky to avoid fetching ase, base-devel, and filesystem.
# For some reason, pacman -Qqs "manjaro" will do that.
log "Checking for soon-to-be Manjaro orphans..."
deps_remove=(
$(pacman -Qqs "manjaro-")
$(pacman -Qqs "\-manjaro")
pacman-mirrors
)
printf "Found:\n${deps_remove[@]}\n"
log "Checking for Pamac..."
deps_pamac=$(pacman -Qqs pamac)
deps_remove+=($deps_pamac)
printf "Found:\n${deps_pamac[@]}\n"
log "Checking for mhwd..."
deps_mhwd=$(pacman -Qqs mhwd)
deps_remove+=($deps_mhwd)
printf "Found:\n${deps_mhwd[@]}\n"
log "Removing old packages and Manjaro orphans..."
pacman -Rdd "${deps_remove[@]}"
log "Checking for reflector..."
if ! is_installed reflector; then
pacman -S yay
@@ -167,10 +193,6 @@ deps_install=(
"protonup-qt"
"proton-cachyos-slr"
)
deps_remove=(
"manjaro-release"
"mhwd"
)
log "Checking for KDE..."
if [[ $(echo $XDG_CURRENT_DESKTOP | grep -i "kde") ]]; then
@@ -182,18 +204,6 @@ if [[ $(echo $XDG_CURRENT_DESKTOP | grep -i "kde") ]]; then
fi
fi
log "Checking for Pamac..."
if [[ $(is_installed pamac-manager) || $(is_installed pamac) ]]; then
prompt_bool "Uninstall Pamac?" true
if [[ $? ]]; then
# TODO: Uninstall pamac deps.
echo -e "${RED}Not implemented!"
fi
fi
log "Removing old packages and Manjaro orphans..."
pacman -R ${deps_remove[@]}
log "Fetching all system packages to replace with CachyOS+Arch packages..."
# Credit to https://insrt.uk/post/pacman-reinstall for this solution.
deps_install+=($(comm -12 <(pacman -Slq | sort -u) <(pacman -Qq | sort -u)))
@@ -201,6 +211,8 @@ deps_install+=($(comm -12 <(pacman -Slq | sort -u) <(pacman -Qq | sort -u)))
log "Installing new packages..."
pacman -Sdd ${deps_install[@]}
chwd --autoconfigure
log "Done."
echo "Quick reminder: Be prepared to fix things!"
echo "Many orphaned packages will still exist on the system, and should be"