diff --git a/core/tabs/applications-setup/alacritty-setup.sh b/core/tabs/applications-setup/alacritty-setup.sh index 8149ebae6..f423fa0f3 100755 --- a/core/tabs/applications-setup/alacritty-setup.sh +++ b/core/tabs/applications-setup/alacritty-setup.sh @@ -12,6 +12,9 @@ installAlacritty() { apk) "$ESCALATION_TOOL" "$PACKAGER" add alacritty ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy alacritty + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y alacritty ;; diff --git a/core/tabs/applications-setup/android-debloat.sh b/core/tabs/applications-setup/android-debloat.sh index 1db9328bd..cb38e1cd5 100644 --- a/core/tabs/applications-setup/android-debloat.sh +++ b/core/tabs/applications-setup/android-debloat.sh @@ -18,6 +18,9 @@ install_adb() { apk) "$ESCALATION_TOOL" "$PACKAGER" add android-tools ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy android-tools + ;; *) printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" exit 1 diff --git a/core/tabs/applications-setup/browsers/chromium.sh b/core/tabs/applications-setup/browsers/chromium.sh index f9f14e74e..ecb202dbb 100644 --- a/core/tabs/applications-setup/browsers/chromium.sh +++ b/core/tabs/applications-setup/browsers/chromium.sh @@ -12,6 +12,9 @@ if ! command_exists chromium; then apk) "$ESCALATION_TOOL" "$PACKAGER" add chromium ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy chromium + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y chromium ;; diff --git a/core/tabs/applications-setup/browsers/firefox.sh b/core/tabs/applications-setup/browsers/firefox.sh index cd36b6c44..e1009d987 100644 --- a/core/tabs/applications-setup/browsers/firefox.sh +++ b/core/tabs/applications-setup/browsers/firefox.sh @@ -18,6 +18,9 @@ installFirefox() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y firefox ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy firefox + ;; apk) "$ESCALATION_TOOL" "$PACKAGER" add firefox ;; diff --git a/core/tabs/applications-setup/browsers/librewolf.sh b/core/tabs/applications-setup/browsers/librewolf.sh index f69745021..f3476e8ff 100644 --- a/core/tabs/applications-setup/browsers/librewolf.sh +++ b/core/tabs/applications-setup/browsers/librewolf.sh @@ -32,6 +32,10 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/ pacman) "$AUR_HELPER" -S --needed --noconfirm librewolf-bin ;; + xbps-install) + printf '%s\n' 'repository=https://github.com/index-0/librewolf-void/releases/latest/download/' | "$ESCALATION_TOOL" tee /etc/xbps.d/20-librewolf.conf > /dev/null + "$ESCALATION_TOOL" "$PACKAGER" -Syu librewolf + ;; apk) checkFlatpak flatpak install flathub io.gitlab.librewolf-community diff --git a/core/tabs/applications-setup/browsers/lynx.sh b/core/tabs/applications-setup/browsers/lynx.sh index f92836913..c6cc9f3e3 100644 --- a/core/tabs/applications-setup/browsers/lynx.sh +++ b/core/tabs/applications-setup/browsers/lynx.sh @@ -12,6 +12,9 @@ installLynx() { apk) "$ESCALATION_TOOL" "$PACKAGER" add lynx ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy lynx + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y lynx ;; diff --git a/core/tabs/applications-setup/browsers/tor-browser.sh b/core/tabs/applications-setup/browsers/tor-browser.sh index cfd6c5f23..562862631 100644 --- a/core/tabs/applications-setup/browsers/tor-browser.sh +++ b/core/tabs/applications-setup/browsers/tor-browser.sh @@ -18,6 +18,9 @@ installTorBrowser() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y torbrowser-launcher ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy torbrowser-launcher + ;; *) printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" exit 1 diff --git a/core/tabs/applications-setup/communication-apps/discord-setup.sh b/core/tabs/applications-setup/communication-apps/discord-setup.sh index 0843a3732..0670562e5 100644 --- a/core/tabs/applications-setup/communication-apps/discord-setup.sh +++ b/core/tabs/applications-setup/communication-apps/discord-setup.sh @@ -20,7 +20,7 @@ installDiscord() { "$ESCALATION_TOOL" "$PACKAGER" install -y "https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" "$ESCALATION_TOOL" "$PACKAGER" install -y discord ;; - apk) + apk | xbps-install) checkFlatpak flatpak install -y flathub com.discordapp.Discord ;; diff --git a/core/tabs/applications-setup/communication-apps/signal-setup.sh b/core/tabs/applications-setup/communication-apps/signal-setup.sh index 48f72ddbd..4fd8880e3 100644 --- a/core/tabs/applications-setup/communication-apps/signal-setup.sh +++ b/core/tabs/applications-setup/communication-apps/signal-setup.sh @@ -23,6 +23,9 @@ installSignal() { checkFlatpak flatpak install -y flathub org.signal.Signal ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy Signal-Desktop + ;; apk) checkFlatpak flatpak install -y flathub org.signal.Signal diff --git a/core/tabs/applications-setup/communication-apps/telegram-setup.sh b/core/tabs/applications-setup/communication-apps/telegram-setup.sh index 54916f60b..6e6bb48b2 100644 --- a/core/tabs/applications-setup/communication-apps/telegram-setup.sh +++ b/core/tabs/applications-setup/communication-apps/telegram-setup.sh @@ -12,6 +12,9 @@ installTelegram() { apk) "$ESCALATION_TOOL" "$PACKAGER" add telegram-desktop ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy telegram-desktop + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y telegram-desktop ;; diff --git a/core/tabs/applications-setup/communication-apps/thunderbird-setup.sh b/core/tabs/applications-setup/communication-apps/thunderbird-setup.sh index f7e80e5ac..6cef51c5e 100644 --- a/core/tabs/applications-setup/communication-apps/thunderbird-setup.sh +++ b/core/tabs/applications-setup/communication-apps/thunderbird-setup.sh @@ -12,6 +12,9 @@ installThunderBird() { apk) "$ESCALATION_TOOL" "$PACKAGER" add thunderbird ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy thunderbird + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird ;; diff --git a/core/tabs/applications-setup/developer-tools/jetbrains-toolbox.sh b/core/tabs/applications-setup/developer-tools/jetbrains-toolbox.sh index 79ce360e3..616c5eeca 100644 --- a/core/tabs/applications-setup/developer-tools/jetbrains-toolbox.sh +++ b/core/tabs/applications-setup/developer-tools/jetbrains-toolbox.sh @@ -31,6 +31,10 @@ installJetBrainsToolBox() { dnf) manualInstall ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy fuse3 + manualInstall + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y libfuse2 manualInstall diff --git a/core/tabs/applications-setup/developer-tools/meld.sh b/core/tabs/applications-setup/developer-tools/meld.sh index 36c1cfe4d..8b867f21f 100644 --- a/core/tabs/applications-setup/developer-tools/meld.sh +++ b/core/tabs/applications-setup/developer-tools/meld.sh @@ -15,6 +15,9 @@ installMeld() { apk) "$ESCALATION_TOOL" "$PACKAGER" add meld ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy meld + ;; *) checkFlatpak flatpak install -y flathub org.gnome.meld diff --git a/core/tabs/applications-setup/developer-tools/neovim.sh b/core/tabs/applications-setup/developer-tools/neovim.sh index 7b3a980cb..a82b31dbd 100755 --- a/core/tabs/applications-setup/developer-tools/neovim.sh +++ b/core/tabs/applications-setup/developer-tools/neovim.sh @@ -32,6 +32,9 @@ installNeovim() { apk) "$ESCALATION_TOOL" "$PACKAGER" add neovim ripgrep fzf py3-virtualenv luarocks go shellcheck git ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy neovim ripgrep fzf python3-virtualenv luarocks go shellcheck git + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/developer-tools/vscode.sh b/core/tabs/applications-setup/developer-tools/vscode.sh index 3a9c7f0e7..ae69eee66 100644 --- a/core/tabs/applications-setup/developer-tools/vscode.sh +++ b/core/tabs/applications-setup/developer-tools/vscode.sh @@ -28,6 +28,9 @@ installVsCode() { printf "%b\n" '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | "$ESCALATION_TOOL" tee /etc/yum.repos.d/vscode.repo > /dev/null "$ESCALATION_TOOL" "$PACKAGER" install -y code ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy vscode + ;; apk) checkFlatpak flatpak install -y flathub com.visualstudio.code diff --git a/core/tabs/applications-setup/docker-setup.sh b/core/tabs/applications-setup/docker-setup.sh index b693656b9..7858c5927 100755 --- a/core/tabs/applications-setup/docker-setup.sh +++ b/core/tabs/applications-setup/docker-setup.sh @@ -46,6 +46,9 @@ install_docker() { apk) "$ESCALATION_TOOL" "$PACKAGER" add docker ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy docker + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 @@ -80,6 +83,9 @@ install_docker_compose() { apk) "$ESCALATION_TOOL" "$PACKAGER" add docker-cli-compose ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy docker-compose + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/dwmtitus-setup.sh b/core/tabs/applications-setup/dwmtitus-setup.sh index e00931aaa..de0a85077 100755 --- a/core/tabs/applications-setup/dwmtitus-setup.sh +++ b/core/tabs/applications-setup/dwmtitus-setup.sh @@ -22,6 +22,9 @@ setupDWM() { zypper) "$ESCALATION_TOOL" "$PACKAGER" install -y make libX11-devel libXinerama-devel libXft-devel imlib2-devel gcc ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy base-devel freetype-devel fontconfig-devel imlib2-devel libXft-devel libXinerama-devel git unzip flameshot lxappearance feh mate-polkit + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 @@ -48,6 +51,9 @@ setupPicomDependencies() { zypper) "$ESCALATION_TOOL" "$PACKAGER" install -y libxcb-devel libxcb-devel dbus-1-devel gcc git libconfig-devel libdrm-devel libev-devel libX11-devel libX11-xcb1 libXext-devel libxcb-devel Mesa-libGL-devel Mesa-libEGL-devel libepoxy-devel meson pcre2-devel uthash-devel xcb-util-image-devel libpixman-1-0-devel xcb-util-renderutil-devel xcb-util-devel ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy meson libev-devel uthash libconfig-devel pixman-devel xcb-util-image-devel xcb-util-renderutil-devel pcre2-devel libepoxy-devel dbus-devel + ;; *) printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" exit 1 @@ -231,6 +237,9 @@ setupDisplayManager() { zypper) "$ESCALATION_TOOL" "$PACKAGER" install -y xinit xorg-x11-server ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy xorg-minimal + ;; *) printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" exit 1 @@ -296,6 +305,12 @@ setupDisplayManager() { zypper) "$ESCALATION_TOOL" "$PACKAGER" install -y "$DM" ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy "$DM" + if [ "$DM" = "lightdm" ]; then + "$ESCALATION_TOOL" "$PACKAGER" -Sy lightdm-gtk-greeter + fi + ;; *) printf "%b\n" "${RED}Unsupported package manager: $PACKAGER${RC}" exit 1 diff --git a/core/tabs/applications-setup/fastfetch-setup.sh b/core/tabs/applications-setup/fastfetch-setup.sh index b087a7d27..da9bc8281 100644 --- a/core/tabs/applications-setup/fastfetch-setup.sh +++ b/core/tabs/applications-setup/fastfetch-setup.sh @@ -6,20 +6,23 @@ installFastfetch() { if ! command_exists fastfetch; then printf "%b\n" "${YELLOW}Installing Fastfetch...${RC}" case "$PACKAGER" in - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm fastfetch - ;; - apt-get | nala) - curl -sSLo /tmp/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-amd64.deb - "$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb - rm /tmp/fastfetch.deb - ;; - apk) - "$ESCALATION_TOOL" "$PACKAGER" add fastfetch - ;; - *) - "$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch - ;; + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm fastfetch + ;; + apt-get|nala) + curl -sSLo /tmp/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-amd64.deb + "$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb + rm /tmp/fastfetch.deb + ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add fastfetch + ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy fastfetch + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch + ;; esac else printf "%b\n" "${GREEN}Fastfetch is already installed.${RC}" diff --git a/core/tabs/applications-setup/kitty-setup.sh b/core/tabs/applications-setup/kitty-setup.sh index c919969d6..aeb660a1e 100755 --- a/core/tabs/applications-setup/kitty-setup.sh +++ b/core/tabs/applications-setup/kitty-setup.sh @@ -12,6 +12,9 @@ installKitty() { apk) "$ESCALATION_TOOL" "$PACKAGER" add kitty ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy kitty + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y kitty ;; diff --git a/core/tabs/applications-setup/mybash-setup.sh b/core/tabs/applications-setup/mybash-setup.sh index 6d28b0a35..2ee6c9ba6 100644 --- a/core/tabs/applications-setup/mybash-setup.sh +++ b/core/tabs/applications-setup/mybash-setup.sh @@ -14,6 +14,9 @@ installDepend() { apk) "$ESCALATION_TOOL" "$PACKAGER" add bash bash-completion tar bat tree unzip fontconfig git ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy bash bash-completion tar bat tree unzip fontconfig git + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y bash bash-completion tar bat tree unzip fontconfig git ;; diff --git a/core/tabs/applications-setup/office-suites/libreoffice.sh b/core/tabs/applications-setup/office-suites/libreoffice.sh index a55bd183e..a191042cb 100644 --- a/core/tabs/applications-setup/office-suites/libreoffice.sh +++ b/core/tabs/applications-setup/office-suites/libreoffice.sh @@ -19,6 +19,9 @@ installLibreOffice() { apk) "$ESCALATION_TOOL" "$PACKAGER" add libreoffice ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy libreoffice + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/pdf-suites/evince.sh b/core/tabs/applications-setup/pdf-suites/evince.sh index 7740b5084..5115546f6 100644 --- a/core/tabs/applications-setup/pdf-suites/evince.sh +++ b/core/tabs/applications-setup/pdf-suites/evince.sh @@ -12,6 +12,9 @@ installEvince() { apk) "$ESCALATION_TOOL" "$PACKAGER" add evince ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy evince + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y evince ;; diff --git a/core/tabs/applications-setup/pdf-suites/okular.sh b/core/tabs/applications-setup/pdf-suites/okular.sh index ab618f081..186c53404 100644 --- a/core/tabs/applications-setup/pdf-suites/okular.sh +++ b/core/tabs/applications-setup/pdf-suites/okular.sh @@ -12,6 +12,9 @@ installOkular() { apk) "$ESCALATION_TOOL" "$PACKAGER" add okular ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy okular + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y okular ;; diff --git a/core/tabs/applications-setup/podman-compose-setup.sh b/core/tabs/applications-setup/podman-compose-setup.sh index 02db3ed7f..642d82c4e 100644 --- a/core/tabs/applications-setup/podman-compose-setup.sh +++ b/core/tabs/applications-setup/podman-compose-setup.sh @@ -18,6 +18,9 @@ installPodmanCompose() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y podman-compose ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy podman-compose + ;; *) printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" exit 1 diff --git a/core/tabs/applications-setup/podman-setup.sh b/core/tabs/applications-setup/podman-setup.sh index 07a0b5f62..f2db75e4e 100644 --- a/core/tabs/applications-setup/podman-setup.sh +++ b/core/tabs/applications-setup/podman-setup.sh @@ -18,6 +18,9 @@ installPodman() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y podman ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy podman + ;; *) printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" exit 1 diff --git a/core/tabs/applications-setup/rofi-setup.sh b/core/tabs/applications-setup/rofi-setup.sh index b4e2609a3..cb1189583 100755 --- a/core/tabs/applications-setup/rofi-setup.sh +++ b/core/tabs/applications-setup/rofi-setup.sh @@ -12,6 +12,9 @@ installRofi() { apk) "$ESCALATION_TOOL" "$PACKAGER" add rofi ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy rofi + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y rofi ;; diff --git a/core/tabs/applications-setup/zsh-setup.sh b/core/tabs/applications-setup/zsh-setup.sh index 65f090ec2..521079931 100644 --- a/core/tabs/applications-setup/zsh-setup.sh +++ b/core/tabs/applications-setup/zsh-setup.sh @@ -13,6 +13,9 @@ installZsh() { apk) "$ESCALATION_TOOL" "$PACKAGER" add zsh ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy zsh + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y zsh ;; diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index c3472c084..d787016e9 100644 --- a/core/tabs/common-script.sh +++ b/core/tabs/common-script.sh @@ -26,6 +26,9 @@ checkFlatpak() { apk) "$ESCALATION_TOOL" "$PACKAGER" add flatpak ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy flatpak + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y flatpak ;; @@ -182,7 +185,7 @@ checkEnv() { checkArch checkEscalationTool checkCommandRequirements "curl groups $ESCALATION_TOOL" - checkPackageManager 'nala apt-get dnf pacman zypper apk' + checkPackageManager 'nala apt-get dnf pacman zypper apk xbps-install' checkCurrentDirectoryWritable checkSuperUser checkDistro diff --git a/core/tabs/security/firewall-baselines.sh b/core/tabs/security/firewall-baselines.sh index 54145ea75..7d403beb5 100644 --- a/core/tabs/security/firewall-baselines.sh +++ b/core/tabs/security/firewall-baselines.sh @@ -12,6 +12,9 @@ installPkg() { apk) "$ESCALATION_TOOL" "$PACKAGER" add ufw ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy ufw + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y ufw ;; diff --git a/core/tabs/system-setup/compile-setup.sh b/core/tabs/system-setup/compile-setup.sh index 234460e19..0a4e2870f 100755 --- a/core/tabs/system-setup/compile-setup.sh +++ b/core/tabs/system-setup/compile-setup.sh @@ -45,6 +45,13 @@ installDepend() { apk) "$ESCALATION_TOOL" "$PACKAGER" add build-base multitail tar tree trash-cli unzip cmake jq ;; + xbps-install) + COMPILEDEPS='base-devel' + # shellcheck disable=SC2086 + "$ESCALATION_TOOL" "$PACKAGER" -Sy $DEPENDENCIES $COMPILEDEPS + "$ESCALATION_TOOL" "$PACKAGER" -Sy void-repo-multilib + "$ESCALATION_TOOL" "$PACKAGER" -Sy glibc-32bit gcc-multilib + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" ;; diff --git a/core/tabs/system-setup/global-theme.sh b/core/tabs/system-setup/global-theme.sh index 07f9d4b22..e57716f42 100755 --- a/core/tabs/system-setup/global-theme.sh +++ b/core/tabs/system-setup/global-theme.sh @@ -17,6 +17,9 @@ install_theme_tools() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qt6ct kvantum ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy qt6ct kvantum + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/system-setup/system-cleanup.sh b/core/tabs/system-setup/system-cleanup.sh index 70cfd5b6f..f212bb549 100755 --- a/core/tabs/system-setup/system-cleanup.sh +++ b/core/tabs/system-setup/system-cleanup.sh @@ -27,6 +27,9 @@ cleanup_system() { apk) "$ESCALATION_TOOL" "$PACKAGER" cache clean ;; + xbps-install) + "$ESCALATION_TOOL" xbps-remove -Ooy + ;; *) printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}" ;; diff --git a/core/tabs/system-setup/system-update.sh b/core/tabs/system-setup/system-update.sh index 9052ad804..a2557e715 100755 --- a/core/tabs/system-setup/system-update.sh +++ b/core/tabs/system-setup/system-update.sh @@ -56,6 +56,9 @@ fastUpdate() { apk) "$ESCALATION_TOOL" "$PACKAGER" update ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -S + ;; *) printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" exit 1 @@ -82,6 +85,9 @@ updateSystem() { apk) "$ESCALATION_TOOL" "$PACKAGER" upgrade ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -yu + ;; *) printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}" exit 1 diff --git a/core/tabs/system-setup/terminus-tty.sh b/core/tabs/system-setup/terminus-tty.sh index 2c1deaa08..d2635b066 100755 --- a/core/tabs/system-setup/terminus-tty.sh +++ b/core/tabs/system-setup/terminus-tty.sh @@ -16,6 +16,9 @@ InstallTermiusFonts() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y terminus-fonts-console ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy terminus-font + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 @@ -28,7 +31,7 @@ InstallTermiusFonts() { SetTermiusFonts() { case "$DTYPE" in - arch) + arch|fedora|void) printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}" "$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then @@ -50,14 +53,6 @@ SetTermiusFonts() { fi printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}" ;; - fedora) - printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}" - "$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf - if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then - "$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b - fi - printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}" - ;; esac } diff --git a/core/tabs/utils/bluetooth-control.sh b/core/tabs/utils/bluetooth-control.sh index f18a32a10..66762ceaf 100644 --- a/core/tabs/utils/bluetooth-control.sh +++ b/core/tabs/utils/bluetooth-control.sh @@ -14,6 +14,9 @@ setupBluetooth() { apk) "$ESCALATION_TOOL" "$PACKAGER" add bluez ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy bluez + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y bluez ;; @@ -22,7 +25,13 @@ setupBluetooth() { printf "%b\n" "${GREEN}Bluez is already installed.${RC}" fi - startService bluetooth + # Set service name based on distribution + SERVICE_NAME="bluetooth" + if [ "$PACKAGER" = "xbps-install" ]; then + SERVICE_NAME="bluetoothd" + fi + + startAndEnableService "$SERVICE_NAME" } # Function to display the main menu diff --git a/core/tabs/utils/encrypt_decrypt_tool.sh b/core/tabs/utils/encrypt_decrypt_tool.sh index 80e8bbc83..cd4ea793e 100644 --- a/core/tabs/utils/encrypt_decrypt_tool.sh +++ b/core/tabs/utils/encrypt_decrypt_tool.sh @@ -22,6 +22,9 @@ if ! command_exists openssl; then apk) "$ESCALATION_TOOL" "$PACKAGER" add openssl ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy openssl + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/utils/printers/install-cups.sh b/core/tabs/utils/printers/install-cups.sh index b70df37a2..762ec4f0c 100644 --- a/core/tabs/utils/printers/install-cups.sh +++ b/core/tabs/utils/printers/install-cups.sh @@ -9,11 +9,11 @@ installCUPS() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm cups ;; - apt-get | nala) + apt-get|nala|dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y cups ;; - dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y cups + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy cups ;; *) printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}" diff --git a/core/tabs/utils/printers/install-epson-printer-drivers.sh b/core/tabs/utils/printers/install-epson-printer-drivers.sh index afaab4bcc..ec70ff919 100644 --- a/core/tabs/utils/printers/install-epson-printer-drivers.sh +++ b/core/tabs/utils/printers/install-epson-printer-drivers.sh @@ -10,12 +10,15 @@ installEpsonPrinterDriver() { pacman) "$AUR_HELPER" -S --noconfirm epson-inkjet-printer-escpr ;; - apt-get | nala) + apt-get|nala) "$ESCALATION_TOOL" "$PACKAGER" install -y printer-driver-escpr ;; dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y epson-inkjet-printer-escpr ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy epson-inkjet-printer-escpr + ;; *) printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}" exit 1 diff --git a/core/tabs/utils/samba-ssh-setup.sh b/core/tabs/utils/samba-ssh-setup.sh index 2de1bf7dc..e74d3cf5b 100755 --- a/core/tabs/utils/samba-ssh-setup.sh +++ b/core/tabs/utils/samba-ssh-setup.sh @@ -14,6 +14,9 @@ install_package() { apk) "$ESCALATION_TOOL" "$PACKAGER" add "$PACKAGE" ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy "$PACKAGE" + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE" ;; @@ -41,6 +44,10 @@ setup_ssh() { install_package openssh SSH_SERVICE="sshd" ;; + xbps-install) + install_package openssh + SSH_SERVICE="sshd" + ;; *) install_package openssh-server SSH_SERVICE="sshd" diff --git a/core/tabs/utils/service-control.sh b/core/tabs/utils/service-control.sh index ea51089f7..a84d8b2df 100644 --- a/core/tabs/utils/service-control.sh +++ b/core/tabs/utils/service-control.sh @@ -1,7 +1,8 @@ #!/bin/sh -e -# Load common script functions -. ../common-script.sh +# Load common script functions and service functions +. ../common-script.sh +. ../common-service-script.sh #external services directory SCRIPT_DIR="./services" @@ -22,32 +23,91 @@ show_menu() { printf "%b\n" "8. Enable a service" printf "%b\n" "9. Disable a service" printf "%b\n" "10. Create a service from external scripts" - printf "%b\n" "11. Exit" + printf "%b\n" "0. Exit" printf "%b\n" "============================" } # Function to view all services view_all_services() { printf "%b\n" "Listing all services..." - "$ESCALATION_TOOL" systemctl list-units --type=service --all --no-legend | awk '{print $1}' | sed 's/\.service//' | more + case "$INIT_MANAGER" in + systemctl) + "$ESCALATION_TOOL" systemctl list-units --type=service --all --no-legend | awk '{print $1}' | sed 's/\.service//' | more + ;; + rc-service) + "$ESCALATION_TOOL" rc-update show | more + ;; + sv) + # shellcheck disable=SC2012 + ls -1 /etc/sv/ | more + ;; + esac } # Function to view enabled services view_enabled_services() { printf "%b\n" "Listing enabled services..." - "$ESCALATION_TOOL" systemctl list-unit-files --type=service --state=enabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more + case "$INIT_MANAGER" in + systemctl) + "$ESCALATION_TOOL" systemctl list-unit-files --type=service --state=enabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more + ;; + rc-service) + "$ESCALATION_TOOL" rc-update show -v | grep "\[" | more + ;; + sv) + # shellcheck disable=SC2012 + if [ -d "/etc/service" ]; then + ls -1 /etc/service/ | more + else + ls -1 /var/service/ | more + fi + ;; + esac } # Function to view disabled services view_disabled_services() { printf "%b\n" "Listing disabled services..." - "$ESCALATION_TOOL" systemctl list-unit-files --type=service --state=disabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more + case "$INIT_MANAGER" in + systemctl) + "$ESCALATION_TOOL" systemctl list-unit-files --type=service --state=disabled --no-legend | awk '{print $1}' | sed 's/\.service//' | more + ;; + rc-service) + "$ESCALATION_TOOL" rc-update show -v | grep -v "\[" | more + ;; + sv) + # shellcheck disable=SC2010 + if [ -d "/etc/service" ]; then + ls -1 /etc/sv/ | grep -v "$(ls -1 /etc/service/)" | more + else + ls -1 /etc/sv/ | grep -v "$(ls -1 /var/service/)" | more + fi + ;; + esac } # Function to view started services view_started_services() { - printf "%b\n" "Listing started services: " - "$ESCALATION_TOOL" systemctl list-units --type=service --state=running --no-pager | head -n -6 | awk 'NR>1 {print $1}' | more + printf "%b\n" "Listing started services..." + case "$INIT_MANAGER" in + systemctl) + "$ESCALATION_TOOL" systemctl list-units --type=service --state=running --no-pager | head -n -6 | awk 'NR>1 {print $1}' | more + ;; + rc-service) + "$ESCALATION_TOOL" rc-status --servicelist | more + ;; + sv) + if [ -d "/etc/service" ]; then + for service in /etc/service/*; do + [ -d "$service" ] && "$ESCALATION_TOOL" sv status "$(basename "$service")" | grep "^run:" >/dev/null && basename "$service" + done | more + else + for service in /var/service/*; do + [ -d "$service" ] && "$ESCALATION_TOOL" sv status "$(basename "$service")" | grep "^run:" >/dev/null && basename "$service" + done | more + fi + ;; + esac } # Function to add a new service @@ -104,8 +164,7 @@ add_service() { read -r START_ENABLE if [ "$START_ENABLE" = "y" ] || [ "$START_ENABLE" = "Y" ]; then - "$ESCALATION_TOOL" systemctl start "$SERVICE_NAME" - "$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME" + startAndEnableService "$SERVICE_NAME" printf "%b\n" "Service $SERVICE_NAME has been started and enabled." else printf "%b\n" "Service $SERVICE_NAME has been created but not started." @@ -117,20 +176,43 @@ remove_service() { printf "%b" "Enter the name of the service to remove (e.g., my_service): " read -r SERVICE_NAME - SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service" - - if [ -f "$SERVICE_FILE" ]; then + if isServiceActive "$SERVICE_NAME"; then printf "%b\n" "Stopping and disabling the service..." - "$ESCALATION_TOOL" systemctl stop "$SERVICE_NAME" - "$ESCALATION_TOOL" systemctl disable "$SERVICE_NAME" - - printf "%b\n" "Removing the service file..." - "$ESCALATION_TOOL" rm -f "$SERVICE_FILE" - "$ESCALATION_TOOL" systemctl daemon-reload - printf "%b\n" "Service $SERVICE_NAME has been removed." - else - printf "%b\n" "Service $SERVICE_NAME does not exist." + stopService "$SERVICE_NAME" + disableService "$SERVICE_NAME" fi + + case "$INIT_MANAGER" in + systemctl) + SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service" + if [ -f "$SERVICE_FILE" ]; then + "$ESCALATION_TOOL" rm -f "$SERVICE_FILE" + "$ESCALATION_TOOL" systemctl daemon-reload + printf "%b\n" "Service $SERVICE_NAME has been removed." + else + printf "%b\n" "Service $SERVICE_NAME does not exist." + fi + ;; + rc-service) + SERVICE_FILE="/etc/init.d/$SERVICE_NAME" + if [ -f "$SERVICE_FILE" ]; then + "$ESCALATION_TOOL" rm -f "$SERVICE_FILE" + printf "%b\n" "Service $SERVICE_NAME has been removed." + else + printf "%b\n" "Service $SERVICE_NAME does not exist." + fi + ;; + sv) + SERVICE_DIR="/etc/sv/$SERVICE_NAME" + if [ -d "$SERVICE_DIR" ]; then + "$ESCALATION_TOOL" rm -rf "$SERVICE_DIR" + "$ESCALATION_TOOL" rm -f "/etc/service/$SERVICE_NAME" "/var/service/$SERVICE_NAME" + printf "%b\n" "Service $SERVICE_NAME has been removed." + else + printf "%b\n" "Service $SERVICE_NAME does not exist." + fi + ;; + esac } # Function to start a service @@ -139,7 +221,7 @@ start_service() { printf "%b" "Enter the name of the service to start (e.g., my_service): " read -r SERVICE_NAME - if "$ESCALATION_TOOL" systemctl start "$SERVICE_NAME"; then + if startService "$SERVICE_NAME"; then printf "%b\n" "Service $SERVICE_NAME has been started." else printf "%b\n" "Failed to start service: $SERVICE_NAME." @@ -152,7 +234,7 @@ stop_service() { printf "%b" "Enter the name of the service to stop (e.g., my_service): " read -r SERVICE_NAME - if "$ESCALATION_TOOL" systemctl stop "$SERVICE_NAME"; then + if stopService "$SERVICE_NAME"; then printf "%b\n" "Service $SERVICE_NAME has been stopped." else printf "%b\n" "Failed to stop service: $SERVICE_NAME." @@ -165,29 +247,28 @@ enable_service() { printf "%b" "Enter the name of the service to enable (e.g., my_service): " read -r SERVICE_NAME - if "$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME"; then + if enableService "$SERVICE_NAME"; then printf "%b\n" "Service $SERVICE_NAME has been enabled." else printf "%b\n" "Failed to enable service: $SERVICE_NAME." fi } -# Function to enable a service +# Function to disable a service disable_service() { view_enabled_services printf "%b" "Enter the name of the service to disable (e.g., my_service): " read -r SERVICE_NAME - if "$ESCALATION_TOOL" systemctl disable "$SERVICE_NAME"; then - printf "%b\n" "Service $SERVICE_NAME has been enabled." + if disableService "$SERVICE_NAME"; then + printf "%b\n" "Service $SERVICE_NAME has been disabled." else - printf "%b\n" "Failed to enable service: $SERVICE_NAME." + printf "%b\n" "Failed to disable service: $SERVICE_NAME." fi } -# Function to create, start, and enable a service from an external service file +# Function to create service from external create_service_from_external() { - # List all .service files in the SCRIPT_DIR printf "%b\n" "============================" printf "%b\n" "Listing available service files" @@ -237,8 +318,7 @@ create_service_from_external() { read -r START_ENABLE if [ "$START_ENABLE" = "y" ]; then - "$ESCALATION_TOOL" systemctl start "$SERVICE_NAME" - "$ESCALATION_TOOL" systemctl enable "$SERVICE_NAME" + startAndEnableService "$SERVICE_NAME" printf "%b\n" "Service $SERVICE_NAME has been started and enabled." else printf "%b\n" "Service $SERVICE_NAME has been created but not started." @@ -262,7 +342,7 @@ main() { 8) enable_service ;; 9) disable_service ;; 10) create_service_from_external ;; - 11) printf "%b\n" "Exiting..."; exit 0 ;; + 0) printf "%b\n" "Exiting..."; exit 0 ;; *) printf "%b\n" "Invalid choice. Please try again." ;; esac diff --git a/core/tabs/utils/utility_functions.sh b/core/tabs/utils/utility_functions.sh index acadee682..3184d686e 100755 --- a/core/tabs/utils/utility_functions.sh +++ b/core/tabs/utils/utility_functions.sh @@ -16,6 +16,9 @@ setup_xrandr() { apk) "$ESCALATION_TOOL" "$PACKAGER" add xrandr ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy xrandr + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y xorg-x11-server-utils ;; diff --git a/core/tabs/utils/wifi-control.sh b/core/tabs/utils/wifi-control.sh index 0a8f05153..afda8143b 100755 --- a/core/tabs/utils/wifi-control.sh +++ b/core/tabs/utils/wifi-control.sh @@ -17,6 +17,9 @@ setupNetworkManager() { apk) "$ESCALATION_TOOL" "$PACKAGER" add networkmanager-wifi iwd ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy NetworkManager iwd + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y network-manager ;; @@ -28,7 +31,7 @@ setupNetworkManager() { # Check if NetworkManager service is running if ! isServiceActive NetworkManager; then printf "%b\n" "${YELLOW}NetworkManager service is not running. Starting it now...${RC}" - startService NetworkManager + startAndEnableService NetworkManager else printf "%b\n" "${GREEN}NetworkManager service started successfully.${RC}" fi