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 1/8] 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 36c1cfe4d..8147839cf 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 7b3a980cb..96528bdbd 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 3a9c7f0e7..681309c16 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 8149ebae6..48774eb2d 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 632580239..f43fde0da 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 f9f14e74e..201d344b1 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 cd36b6c44..01c9c5cdc 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 d8ed06b41..88f839bde 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..17b03e987 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 cfd6c5f23..6d0ee405d 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 f96bd9f2e..4e99db8aa 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 18c462b1c..bb52e2e12 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 54916f60b..09910b1f8 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 f7e80e5ac..37de53686 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 b693656b9..ddcb45a10 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 5374805ea..697954700 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 c919969d6..8e5378b3b 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 6d28b0a35..29870a5d2 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 a55bd183e..cb2069492 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 7740b5084..27b1ed28e 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 ab618f081..15c0253f5 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 02db3ed7f..cd63b2e85 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 07a0b5f62..b354c4641 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 b4e2609a3..e4a6cb27d 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 65f090ec2..e242df295 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 54145ea75..1171ed88d 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 bb6bb44a9..b5d7acf6b 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 07f9d4b22..5b6cb4e6a 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 dccbcf3a4..624b60337 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 9052ad804..54bc0e0a2 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 2c1deaa08..f9d674737 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 6bfe266ba..d44d52b88 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 40e006a25..26137c40a 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 b70df37a2..9a3dc6ba4 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 afaab4bcc..439753278 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 aa0dc30ea..6d2f9afd2 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 903fa826d..c99f0ca23 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 09f33c60a..a9eba2c24 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 d4ed2d10b..5ba607c88 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 ;; From 6b95d5848525f83c929c8a134cfc3d4b0a3bf28e Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Sat, 11 Jan 2025 09:37:57 -0500 Subject: [PATCH 2/8] Update core/tabs/system-setup/compile-setup.sh Co-authored-by: Adam Perkowski --- core/tabs/system-setup/compile-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/compile-setup.sh b/core/tabs/system-setup/compile-setup.sh index b5d7acf6b..5568fa922 100755 --- a/core/tabs/system-setup/compile-setup.sh +++ b/core/tabs/system-setup/compile-setup.sh @@ -42,7 +42,7 @@ installDepend() { ;; xbps-install) COMPILEDEPS='base-devel' - "$ESCALATION_TOOL" "$PACKAGER" -y $DEPENDENCIES $COMPILEDEPS + "$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 From f32ab0bf9a01fc4ac8584928e903bbd02ded4c12 Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Sat, 11 Jan 2025 09:45:45 -0500 Subject: [PATCH 3/8] Update common-script.sh forgot to add xbps-install --- core/tabs/common-script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index c3472c084..b23763b6a 100644 --- a/core/tabs/common-script.sh +++ b/core/tabs/common-script.sh @@ -182,7 +182,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 From dcc1c5be7019d82045f5d3f09d4b0340b8d05121 Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Sat, 11 Jan 2025 10:19:56 -0500 Subject: [PATCH 4/8] Update alacritty-setup.sh missing letter --- core/tabs/applications-setup/alacritty-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/applications-setup/alacritty-setup.sh b/core/tabs/applications-setup/alacritty-setup.sh index 48774eb2d..b9183e96e 100755 --- a/core/tabs/applications-setup/alacritty-setup.sh +++ b/core/tabs/applications-setup/alacritty-setup.sh @@ -12,7 +12,7 @@ installAlacritty() { apk) "$ESCALATION_TOOL" "$PACKAGER" add alacritty ;; - bps-install) + xbps-install) "$ESCALATION_TOOL" "$PACKAGER" -y alacritty ;; *) From d47b3a77d4236769c9ef91e3cf026942e3c75b9d Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Sat, 11 Jan 2025 11:08:15 -0500 Subject: [PATCH 5/8] Update core/tabs/system-setup/compile-setup.sh Awesome. Thanks for helping me learn all this stuff. Co-authored-by: Adam Perkowski --- core/tabs/system-setup/compile-setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/tabs/system-setup/compile-setup.sh b/core/tabs/system-setup/compile-setup.sh index 5568fa922..e93614534 100755 --- a/core/tabs/system-setup/compile-setup.sh +++ b/core/tabs/system-setup/compile-setup.sh @@ -42,7 +42,8 @@ installDepend() { ;; xbps-install) COMPILEDEPS='base-devel' - "$ESCALATION_TOOL" "$PACKAGER" -y "$DEPENDENCIES" "$COMPILEDEPS" + # shellcheck disable=SC2086 + "$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 From 73897f6631b4a51dc8341325793b95c1dc636a4d Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Sat, 18 Jan 2025 15:54:59 -0500 Subject: [PATCH 6/8] add flatpak --- core/tabs/common-script.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index b23763b6a..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 ;; From 80c3c056ba4ab369eb3ec89fe5d557648cc4c7f3 Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Mon, 20 Jan 2025 20:22:01 -0500 Subject: [PATCH 7/8] replace runit with sv --- core/tabs/utils/service-control.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/tabs/utils/service-control.sh b/core/tabs/utils/service-control.sh index c99f0ca23..6b1ec6b19 100644 --- a/core/tabs/utils/service-control.sh +++ b/core/tabs/utils/service-control.sh @@ -37,7 +37,7 @@ view_all_services() { rc-service) "$ESCALATION_TOOL" rc-update show | more ;; - runit) + sv) ls -1 /etc/sv/ | more ;; esac @@ -53,7 +53,7 @@ view_enabled_services() { rc-service) "$ESCALATION_TOOL" rc-update show -v | grep "\[" | more ;; - runit) + sv) ls -1 /var/service/ | more ;; esac @@ -69,7 +69,7 @@ view_disabled_services() { rc-service) "$ESCALATION_TOOL" rc-update show -v | grep -v "\[" | more ;; - runit) + sv) ls -1 /etc/sv/ | grep -v "$(ls -1 /var/service/)" | more ;; esac @@ -85,7 +85,7 @@ view_started_services() { rc-service) "$ESCALATION_TOOL" rc-status --servicelist | more ;; - runit) + sv) for service in /var/service/*; do [ -d "$service" ] && "$ESCALATION_TOOL" sv status "$(basename "$service")" | grep "^run:" >/dev/null && basename "$service" done | more @@ -185,7 +185,7 @@ remove_service() { printf "%b\n" "Service $SERVICE_NAME does not exist." fi ;; - runit) + sv) SERVICE_DIR="/etc/sv/$SERVICE_NAME" if [ -d "$SERVICE_DIR" ]; then "$ESCALATION_TOOL" rm -rf "$SERVICE_DIR" @@ -335,4 +335,4 @@ main() { checkEnv checkEscalationTool -main \ No newline at end of file +main From 01d126e43cd7fdbfe275ae54e24e81fa97f47044 Mon Sep 17 00:00:00 2001 From: Jaredy899 <76603258+Jaredy899@users.noreply.github.com> Date: Mon, 3 Feb 2025 21:34:40 -0500 Subject: [PATCH 8/8] slight fix for consistency --- core/tabs/system-setup/system-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/system-update.sh b/core/tabs/system-setup/system-update.sh index 54bc0e0a2..e5df221f3 100755 --- a/core/tabs/system-setup/system-update.sh +++ b/core/tabs/system-setup/system-update.sh @@ -57,7 +57,7 @@ fastUpdate() { "$ESCALATION_TOOL" "$PACKAGER" update ;; xbps-install) - "$ESCALATION_TOOL" xbps-install -S + "$ESCALATION_TOOL" "$PACKAGER" -S ;; *) printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}${RC}"