From e44b900c0e347bbaf1099cf20f19f67d115ea51b Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Sat, 11 Jan 2025 08:27:27 -0500 Subject: [PATCH] Void --- .../Developer-tools/meld-setup.sh | 3 + .../Developer-tools/neovim-setup.sh | 3 + .../Developer-tools/vscode-setup.sh | 3 + .../applications-setup/alacritty-setup.sh | 3 + .../applications-setup/android-debloat.sh | 3 + .../applications-setup/browsers/chromium.sh | 3 + .../applications-setup/browsers/firefox.sh | 3 + .../applications-setup/browsers/librewolf.sh | 4 + core/tabs/applications-setup/browsers/lynx.sh | 3 + .../browsers/tor-browser.sh | 3 + .../communication-apps/discord-setup.sh | 3 + .../communication-apps/signal-setup.sh | 3 + .../communication-apps/telegram-setup.sh | 3 + .../communication-apps/thunderbird-setup.sh | 3 + core/tabs/applications-setup/docker-setup.sh | 6 + .../applications-setup/fastfetch-setup.sh | 3 + core/tabs/applications-setup/kitty-setup.sh | 3 + core/tabs/applications-setup/mybash-setup.sh | 3 + .../office-suites/libreoffice.sh | 3 + .../applications-setup/pdf-suites/evince.sh | 3 + .../applications-setup/pdf-suites/okular.sh | 3 + .../podman-compose-setup.sh | 3 + core/tabs/applications-setup/podman-setup.sh | 3 + core/tabs/applications-setup/rofi-setup.sh | 3 + core/tabs/applications-setup/zsh-setup.sh | 3 + core/tabs/security/firewall-baselines.sh | 3 + core/tabs/system-setup/compile-setup.sh | 7 + core/tabs/system-setup/global-theme.sh | 3 + core/tabs/system-setup/system-cleanup.sh | 3 + core/tabs/system-setup/system-update.sh | 6 + core/tabs/system-setup/terminus-tty.sh | 13 +- core/tabs/utils/bluetooth-control.sh | 3 + core/tabs/utils/encrypt_decrypt_tool.sh | 3 + core/tabs/utils/printers/install-cups.sh | 6 +- .../printers/install-epson-printer-drivers.sh | 5 +- core/tabs/utils/samba-ssh-setup.sh | 7 + core/tabs/utils/service-control.sh | 126 +++++++++++++----- core/tabs/utils/utility_functions.sh | 3 + core/tabs/utils/wifi-control.sh | 3 + 39 files changed, 225 insertions(+), 45 deletions(-) diff --git a/core/tabs/applications-setup/Developer-tools/meld-setup.sh b/core/tabs/applications-setup/Developer-tools/meld-setup.sh index 36c1cfe4..8147839c 100644 --- a/core/tabs/applications-setup/Developer-tools/meld-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/meld-setup.sh @@ -15,6 +15,9 @@ installMeld() { apk) "$ESCALATION_TOOL" "$PACKAGER" add meld ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -y meld + ;; *) checkFlatpak flatpak install -y flathub org.gnome.meld diff --git a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh index 7b3a980c..96528bdb 100755 --- a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/neovim-setup.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" -y 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-setup.sh b/core/tabs/applications-setup/Developer-tools/vscode-setup.sh index 3a9c7f0e..681309c1 100644 --- a/core/tabs/applications-setup/Developer-tools/vscode-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/vscode-setup.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" -y vscode + ;; apk) checkFlatpak flatpak install -y flathub com.visualstudio.code diff --git a/core/tabs/applications-setup/alacritty-setup.sh b/core/tabs/applications-setup/alacritty-setup.sh index 8149ebae..48774eb2 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 ;; + bps-install) + "$ESCALATION_TOOL" "$PACKAGER" -y 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 63258023..f43fde0d 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" -y 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 f9f14e74..201d344b 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" -y 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 cd36b6c4..01c9c5cd 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" -y 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 d8ed06b4..88f839bd 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 f9283691..17b03e98 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" -y 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 cfd6c5f2..6d0ee405 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" -y 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 f96bd9f2..4e99db8a 100644 --- a/core/tabs/applications-setup/communication-apps/discord-setup.sh +++ b/core/tabs/applications-setup/communication-apps/discord-setup.sh @@ -20,6 +20,9 @@ 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 ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -y Signal-Desktop + ;; apk) 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 18c462b1..bb52e2e1 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" -y 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 54916f60..09910b1f 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" -y 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 f7e80e5a..37de5368 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" -y thunderbird + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y thunderbird ;; diff --git a/core/tabs/applications-setup/docker-setup.sh b/core/tabs/applications-setup/docker-setup.sh index b693656b..ddcb45a1 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" -y 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" -y docker-compose + ;; *) 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 5374805e..69795470 100644 --- a/core/tabs/applications-setup/fastfetch-setup.sh +++ b/core/tabs/applications-setup/fastfetch-setup.sh @@ -17,6 +17,9 @@ installFastfetch() { apk) "$ESCALATION_TOOL" "$PACKAGER" add fastfetch ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -y fastfetch + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch ;; diff --git a/core/tabs/applications-setup/kitty-setup.sh b/core/tabs/applications-setup/kitty-setup.sh index c919969d..8e5378b3 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" -y 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 6d28b0a3..29870a5d 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" -y 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 a55bd183..cb206949 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" -y 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 7740b508..27b1ed28 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" -y 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 ab618f08..15c0253f 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" -y 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 02db3ed7..cd63b2e8 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" -y 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 07a0b5f6..b354c464 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" -y 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 b4e2609a..e4a6cb27 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" -y 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 65f090ec..e242df29 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" -y zsh + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y zsh ;; diff --git a/core/tabs/security/firewall-baselines.sh b/core/tabs/security/firewall-baselines.sh index 54145ea7..1171ed88 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" -y 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 bb6bb44a..b5d7acf6 100755 --- a/core/tabs/system-setup/compile-setup.sh +++ b/core/tabs/system-setup/compile-setup.sh @@ -40,6 +40,13 @@ installDepend() { apk) "$ESCALATION_TOOL" "$PACKAGER" add build-base multitail tar tree trash-cli unzip cmake jq ;; + xbps-install) + COMPILEDEPS='base-devel' + "$ESCALATION_TOOL" "$PACKAGER" -y $DEPENDENCIES $COMPILEDEPS + "$ESCALATION_TOOL" "$PACKAGER" -y void-repo-multilib + "$ESCALATION_TOOL" "$PACKAGER" -Sy + "$ESCALATION_TOOL" "$PACKAGER" -y 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 07f9d4b2..5b6cb4e6 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" -y 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 dccbcf3a..624b6033 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 -Oo + ;; *) 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 9052ad80..54bc0e0a 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" xbps-install -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" -Su + ;; *) 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 2c1deaa0..f9d67473 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" -y 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 6bfe266b..d44d52b8 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" -y bluez + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y bluez ;; diff --git a/core/tabs/utils/encrypt_decrypt_tool.sh b/core/tabs/utils/encrypt_decrypt_tool.sh index 40e006a2..26137c40 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" -y 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 b70df37a..9a3dc6ba 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" -y 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 afaab4bc..43975327 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" -y 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 aa0dc30e..6d2f9afd 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" -y "$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 903fa826..c99f0ca2 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" @@ -29,25 +30,67 @@ show_menu() { # 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 + ;; + runit) + 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 + ;; + runit) + ls -1 /var/service/ | more + ;; + 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 + ;; + runit) + ls -1 /etc/sv/ | grep -v "$(ls -1 /var/service/)" | more + ;; + 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 + ;; + runit) + for service in /var/service/*; do + [ -d "$service" ] && "$ESCALATION_TOOL" sv status "$(basename "$service")" | grep "^run:" >/dev/null && basename "$service" + done | more + ;; + esac } # Function to add a new service @@ -104,8 +147,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 +159,42 @@ 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 + ;; + runit) + SERVICE_DIR="/etc/sv/$SERVICE_NAME" + if [ -d "$SERVICE_DIR" ]; then + "$ESCALATION_TOOL" rm -rf "$SERVICE_DIR" + 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 +203,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 +216,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 +229,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 +300,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." diff --git a/core/tabs/utils/utility_functions.sh b/core/tabs/utils/utility_functions.sh index 09f33c60..a9eba2c2 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" -y 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 d4ed2d10..5ba607c8 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" -y NetworkManager iwd + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y network-manager ;;