install_package() { # If for some reason we have to change AUR helpers, this function should make it easy to update everything all at once. # make sure system is up to date yay --sudoflags "${sudoFlags[@]}" --sudoloop --noconfirm -Syu yay --sudoflags "${sudoFlags[@]}" --sudoloop --needed --noconfirm -Sy "$@" } url_install() { local url="$1" local tmpfile tmpfile=$(mktemp /tmp/pkg.XXXXXX.pkg.tar.xz) # Make sure system is up to date yay --sudoflags "${sudoFlags[@]}" --sudoloop --noconfirm -Syu if curl -fL --retry 10 -o "$tmpfile" "$url"; then yay --sudoflags "${sudoFlags[@]}" --sudoloop --noconfirm -U "$tmpfile" fi rm -f "$tmpfile" } restart() { if dialog --clear --backtitle "Stormux" --yesno "Would you like to reboot now to apply changes?" 10 80 ; then sudo "${sudoFlags[@]}" reboot fi } attention() { play -qnV0 synth 3 pluck D3 pluck A3 pluck D4 pluck F4 pluck A4 delay 0 .1 .2 .3 .4 remix - chorus 0.9 0.9 38 0.75 0.3 0.5 -t } install_xlibre() { # Make sure system is up to date yay --sudoflags "${sudoFlags[@]}" --sudoloop --noconfirm -Syu # Check if we have internet connectivity if ! ping -c 1 aarch64.stormux.org &>/dev/null; then msgbox "No internet connection detected. X11Libre installation requires internet access." return 1 fi # Add StormUX repository to pacman.conf if not already present if ! grep -q "aarch64.stormux.org" /etc/pacman.conf; then infobox "Adding StormUX repository..." echo -e "\n[stormux]\nSigLevel = Never\nServer = https://aarch64.stormux.org" | sudo "${sudoFlags[@]}" tee -a /etc/pacman.conf > /dev/null sudo "${sudoFlags[@]}" pacman -Syy fi # Remove conflicting packages infobox "Removing conflicting Xorg packages..." sudo "${sudoFlags[@]}" pacman -R --noconfirm xorg-server xf86-input-libinput xf86-video-fbdev 2>/dev/null || true # Install X11Libre packages from StormUX repository infobox "Installing X11Libre server and drivers..." if ! sudo "${sudoFlags[@]}" pacman -S --noconfirm xlibre-server-common-git xlibre-server-devel-git; then msgbox "Failed to install X11Libre server components." return 1 fi if ! sudo "${sudoFlags[@]}" pacman -Sdd --noconfirm xlibre-server-git; then msgbox "Failed to install X11Libre server main package." return 1 fi # Install input and video drivers if ! sudo "${sudoFlags[@]}" pacman -S --noconfirm xf86-input-libinput-xlibre xf86-video-dummy-with-vt xf86-video-fbdev; then msgbox "Failed to install X11Libre input and video drivers." return 1 fi infobox "X11Libre installation completed successfully!" return 0 }