Rearrange install.sh to split Arch thingy apart

This commit is contained in:
clsty
2025-10-01 20:44:25 +08:00
parent 18e2f5dd7f
commit 87c031b825
10 changed files with 355 additions and 371 deletions
+1 -41
View File
@@ -1,6 +1,4 @@
# This file is provided for non-Arch(based) distros.
# As for Arch Linux, we use local PKGBUILDs or AUR packages, which is the "right" way compared to copying files directly into /usr/local/* .
# P.S. install-yay() should be kept for Arch(based) distros.
# This file is provided for any distros, mainly non-Arch(based) distros.
# This script depends on `functions' .
# This is NOT a script for execution, but for loading functions, so NOT need execution permission or shebang.
@@ -10,19 +8,6 @@
# cd "$(dirname "$0")"
# export base="$(pwd)"
# Only for Arch(based) distro.
install-yay() {
x sudo pacman -S --needed --noconfirm base-devel
x git clone https://aur.archlinux.org/yay-bin.git /tmp/buildyay
x cd /tmp/buildyay
x makepkg -o
x makepkg -se
x makepkg -i --noconfirm
x cd $base
rm -rf /tmp/buildyay
}
# Not for Arch(based) distro.
install-agsv1 (){
x mkdir -p $base/cache/agsv1
x cd $base/cache/agsv1
@@ -38,7 +23,6 @@ install-agsv1 (){
x cd $base
}
# Not for Arch(based) distro.
install-Rubik (){
x mkdir -p $base/cache/Rubik
x cd $base/cache/Rubik
@@ -54,7 +38,6 @@ install-Rubik (){
x cd $base
}
# Not for Arch(based) distro.
install-Gabarito (){
x mkdir -p $base/cache/Gabarito
x cd $base/cache/Gabarito
@@ -69,7 +52,6 @@ install-Gabarito (){
x cd $base
}
# Not for Arch(based) distro.
install-OneUI (){
x mkdir -p $base/cache/OneUI4-Icons
x cd $base/cache/OneUI4-Icons
@@ -84,7 +66,6 @@ install-OneUI (){
x cd $base
}
# Not for Arch(based) distro.
install-bibata (){
x mkdir -p $base/cache/bibata-cursor
x cd $base/cache/bibata-cursor
@@ -98,7 +79,6 @@ install-bibata (){
x cd $base
}
# Not for Arch(based) distro.
install-MicroTeX (){
x mkdir -p $base/cache/MicroTeX
x cd $base/cache/MicroTeX
@@ -115,12 +95,10 @@ install-MicroTeX (){
x cd $base
}
# Not for Arch(based) distro.
install-uv (){
x bash <(curl -LJs "https://astral.sh/uv/install.sh")
}
# Both for Arch(based) and other distros.
install-python-packages (){
UV_NO_MODIFY_PATH=1
ILLOGICAL_IMPULSE_VIRTUAL_ENV=$XDG_STATE_HOME/quickshell/.venv
@@ -131,21 +109,3 @@ install-python-packages (){
x uv pip install -r scriptdata/requirements.txt
x deactivate # We don't need the virtual environment anymore
}
# Only for Arch(based) distro.
handle-deprecated-dependencies (){
printf "\e[36m[$0]: Removing deprecated dependencies:\e[0m\n"
for i in illogical-impulse-{microtex,pymyc-aur,ags,agsv1} {hyprutils,hyprpicker,hyprlang,hypridle,hyprland-qt-support,hyprland-qtutils,hyprlock,xdg-desktop-portal-hyprland,hyprcursor,hyprwayland-scanner,hyprland}-git;do try sudo pacman --noconfirm -Rdd $i;done
# Convert old dependencies to non explicit dependencies so that they can be orphaned if not in meta packages
remove_bashcomments_emptylines ./scriptdata/previous_dependencies.conf ./cache/old_deps_stripped.conf
readarray -t old_deps_list < ./cache/old_deps_stripped.conf
pacman -Qeq > ./cache/pacman_explicit_packages
readarray -t explicitly_installed < ./cache/pacman_explicit_packages
echo "Attempting to set previously explicitly installed deps as implicit..."
for i in "${explicitly_installed[@]}"; do for j in "${old_deps_list[@]}"; do
[ "$i" = "$j" ] && yay -D --asdeps "$i"
done; done
return 0
}