From 0f79e007259f714c3fb77eed35965667da1e0498 Mon Sep 17 00:00:00 2001 From: Jeevitha Kannan K S Date: Sun, 13 Oct 2024 07:12:34 +0530 Subject: [PATCH 1/5] Add basic apk to scripts --- .../tabs/applications-setup/Developer-tools/meld-setup.sh | 3 +++ .../applications-setup/Developer-tools/neovim-setup.sh | 3 +++ core/tabs/applications-setup/alacritty-setup.sh | 3 +++ core/tabs/applications-setup/android-debloat.sh | 3 +++ core/tabs/applications-setup/browsers/chromium.sh | 3 +++ core/tabs/applications-setup/browsers/firefox.sh | 3 +++ core/tabs/applications-setup/browsers/librewolf.sh | 3 +++ core/tabs/applications-setup/browsers/lynx.sh | 3 +++ .../applications-setup/communication-apps/jitsi-setup.sh | 3 +++ .../applications-setup/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 ++++++ core/tabs/applications-setup/fastfetch-setup.sh | 3 +++ core/tabs/applications-setup/kitty-setup.sh | 3 +++ core/tabs/applications-setup/linutil-installer.sh | 8 ++++++++ core/tabs/applications-setup/linutil-updater.sh | 7 +++++++ core/tabs/applications-setup/mybash-setup.sh | 3 +++ core/tabs/applications-setup/office-suites/libreoffice.sh | 3 +++ core/tabs/applications-setup/pdf-suites/evince.sh | 3 +++ core/tabs/applications-setup/pdf-suites/okular.sh | 3 +++ core/tabs/applications-setup/rofi-setup.sh | 3 +++ core/tabs/applications-setup/zsh-setup.sh | 3 +++ core/tabs/common-script.sh | 2 +- core/tabs/security/firewall-baselines.sh | 3 +++ core/tabs/system-setup/compile-setup.sh | 3 +++ core/tabs/system-setup/global-theme.sh | 3 +++ core/tabs/system-setup/system-cleanup.sh | 3 +++ core/tabs/system-setup/system-update.sh | 7 +++++++ core/tabs/utils/encrypt_decrypt_tool.sh | 3 +++ core/tabs/utils/power-profile.sh | 3 +++ core/tabs/utils/samba-ssh-setup.sh | 7 +++++++ core/tabs/utils/timeshift.sh | 4 +++- core/tabs/utils/utility_functions.sh | 3 +++ core/tabs/utils/wifi-control.sh | 3 +++ 35 files changed, 123 insertions(+), 2 deletions(-) diff --git a/core/tabs/applications-setup/Developer-tools/meld-setup.sh b/core/tabs/applications-setup/Developer-tools/meld-setup.sh index bd0bb3c2..86a909ec 100644 --- a/core/tabs/applications-setup/Developer-tools/meld-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/meld-setup.sh @@ -12,6 +12,9 @@ installMeld() { apt-get|nala) "$ESCALATION_TOOL" "$PACKAGER" -y install meld ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add meld + ;; *) . ../setup-flatpak.sh 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 ac0d2637..eaaa88f9 100755 --- a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh @@ -29,6 +29,9 @@ installNeovim() { dnf|zypper) "$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add neovim + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/alacritty-setup.sh b/core/tabs/applications-setup/alacritty-setup.sh index 25558fed..8149ebae 100755 --- a/core/tabs/applications-setup/alacritty-setup.sh +++ b/core/tabs/applications-setup/alacritty-setup.sh @@ -9,6 +9,9 @@ installAlacritty() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm alacritty ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 b4e1073a..63258023 100644 --- a/core/tabs/applications-setup/android-debloat.sh +++ b/core/tabs/applications-setup/android-debloat.sh @@ -15,6 +15,9 @@ install_adb() { dnf|zypper) "$ESCALATION_TOOL" "$PACKAGER" install -y android-tools ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 e929dbc9..f9f14e74 100644 --- a/core/tabs/applications-setup/browsers/chromium.sh +++ b/core/tabs/applications-setup/browsers/chromium.sh @@ -9,6 +9,9 @@ if ! command_exists chromium; then pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm chromium ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 67980858..cd36b6c4 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 ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add firefox + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/browsers/librewolf.sh b/core/tabs/applications-setup/browsers/librewolf.sh index a630b9c7..3320a68d 100644 --- a/core/tabs/applications-setup/browsers/librewolf.sh +++ b/core/tabs/applications-setup/browsers/librewolf.sh @@ -32,6 +32,9 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/ pacman) "$AUR_HELPER" -S --needed --noconfirm librewolf-bin ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add librewolf + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/browsers/lynx.sh b/core/tabs/applications-setup/browsers/lynx.sh index 002ff7e3..f9283691 100644 --- a/core/tabs/applications-setup/browsers/lynx.sh +++ b/core/tabs/applications-setup/browsers/lynx.sh @@ -9,6 +9,9 @@ installLynx() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm lynx ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add lynx + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y lynx ;; diff --git a/core/tabs/applications-setup/communication-apps/jitsi-setup.sh b/core/tabs/applications-setup/communication-apps/jitsi-setup.sh index 2b6b4bbe..72133e56 100644 --- a/core/tabs/applications-setup/communication-apps/jitsi-setup.sh +++ b/core/tabs/applications-setup/communication-apps/jitsi-setup.sh @@ -21,6 +21,9 @@ installJitsi() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y jitsi-meet ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add jitsi-meet + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/communication-apps/signal-setup.sh b/core/tabs/applications-setup/communication-apps/signal-setup.sh index 7f5d70fc..00dec431 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() { "$ESCALATION_TOOL" "$PACKAGER" copr enable luminoso/Signal-Desktop "$ESCALATION_TOOL" "$PACKAGER" install -y signal-desktop ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add signal-desktop + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/communication-apps/telegram-setup.sh b/core/tabs/applications-setup/communication-apps/telegram-setup.sh index a21b53e4..54916f60 100644 --- a/core/tabs/applications-setup/communication-apps/telegram-setup.sh +++ b/core/tabs/applications-setup/communication-apps/telegram-setup.sh @@ -9,6 +9,9 @@ installTelegram() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm telegram-desktop ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 f49dcb78..f7e80e5a 100644 --- a/core/tabs/applications-setup/communication-apps/thunderbird-setup.sh +++ b/core/tabs/applications-setup/communication-apps/thunderbird-setup.sh @@ -9,6 +9,9 @@ installThunderBird() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm thunderbird ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 afcd1572..5ddc2257 100755 --- a/core/tabs/applications-setup/docker-setup.sh +++ b/core/tabs/applications-setup/docker-setup.sh @@ -36,6 +36,9 @@ install_docker() { "$ESCALATION_TOOL" systemctl enable docker "$ESCALATION_TOOL" systemctl start docker ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add docker + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 @@ -55,6 +58,9 @@ install_docker_compose() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm docker-compose ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add docker-cli-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 cb523441..5374805e 100644 --- a/core/tabs/applications-setup/fastfetch-setup.sh +++ b/core/tabs/applications-setup/fastfetch-setup.sh @@ -14,6 +14,9 @@ installFastfetch() { "$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb rm /tmp/fastfetch.deb ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 85ef129b..c919969d 100755 --- a/core/tabs/applications-setup/kitty-setup.sh +++ b/core/tabs/applications-setup/kitty-setup.sh @@ -9,6 +9,9 @@ installKitty() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm kitty ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add kitty + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y kitty ;; diff --git a/core/tabs/applications-setup/linutil-installer.sh b/core/tabs/applications-setup/linutil-installer.sh index 4bb241db..e7e4d3d2 100755 --- a/core/tabs/applications-setup/linutil-installer.sh +++ b/core/tabs/applications-setup/linutil-installer.sh @@ -45,6 +45,14 @@ installLinutil() { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y . $HOME/.cargo/env ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add build-base + "$ESCALATION_TOOL" sed -i '/community/s/^#//' /etc/apk/repositories + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" add rustup + rustup-init + . $HOME/.cargo/env + ;; *) curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y . $HOME/.cargo/env diff --git a/core/tabs/applications-setup/linutil-updater.sh b/core/tabs/applications-setup/linutil-updater.sh index 8cf1762d..6c95fae5 100755 --- a/core/tabs/applications-setup/linutil-updater.sh +++ b/core/tabs/applications-setup/linutil-updater.sh @@ -19,6 +19,13 @@ updateLinutil() { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh . $HOME/.cargo/env ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add build-base + "$ESCALATION_TOOL" sed -i '/community/s/^#//' /etc/apk/repositories + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" add rustup + rustup-init + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y rustup ;; diff --git a/core/tabs/applications-setup/mybash-setup.sh b/core/tabs/applications-setup/mybash-setup.sh index 7cda9942..4f45bc95 100644 --- a/core/tabs/applications-setup/mybash-setup.sh +++ b/core/tabs/applications-setup/mybash-setup.sh @@ -11,6 +11,9 @@ installDepend() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm bash bash-completion tar bat tree unzip fontconfig git ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 a9850fdc..6f7301ce 100644 --- a/core/tabs/applications-setup/office-suites/libreoffice.sh +++ b/core/tabs/applications-setup/office-suites/libreoffice.sh @@ -16,6 +16,9 @@ installLibreOffice() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 9e0d8da0..f2129f17 100644 --- a/core/tabs/applications-setup/pdf-suites/evince.sh +++ b/core/tabs/applications-setup/pdf-suites/evince.sh @@ -9,6 +9,9 @@ installEvince() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm evince ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 6ed8d4d1..7f8fd751 100644 --- a/core/tabs/applications-setup/pdf-suites/okular.sh +++ b/core/tabs/applications-setup/pdf-suites/okular.sh @@ -9,6 +9,9 @@ installOkular() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm okular ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add okular + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y okular ;; diff --git a/core/tabs/applications-setup/rofi-setup.sh b/core/tabs/applications-setup/rofi-setup.sh index 24ce1a67..b4e2609a 100755 --- a/core/tabs/applications-setup/rofi-setup.sh +++ b/core/tabs/applications-setup/rofi-setup.sh @@ -9,6 +9,9 @@ installRofi() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm rofi ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 a85b9240..65f090ec 100644 --- a/core/tabs/applications-setup/zsh-setup.sh +++ b/core/tabs/applications-setup/zsh-setup.sh @@ -10,6 +10,9 @@ installZsh() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zsh ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add zsh + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y zsh ;; diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index 12ab1146..ed83753a 100644 --- a/core/tabs/common-script.sh +++ b/core/tabs/common-script.sh @@ -127,7 +127,7 @@ checkDistro() { checkEnv() { checkEscalationTool checkCommandRequirements "curl groups $ESCALATION_TOOL" - checkPackageManager 'nala apt-get dnf pacman zypper' + checkPackageManager 'nala apt-get dnf pacman zypper apk' checkCurrentDirectoryWritable checkSuperUser checkDistro diff --git a/core/tabs/security/firewall-baselines.sh b/core/tabs/security/firewall-baselines.sh index 9c0810f4..54145ea7 100644 --- a/core/tabs/security/firewall-baselines.sh +++ b/core/tabs/security/firewall-baselines.sh @@ -9,6 +9,9 @@ installPkg() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm ufw ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 74a96a41..bb6bb44a 100755 --- a/core/tabs/system-setup/compile-setup.sh +++ b/core/tabs/system-setup/compile-setup.sh @@ -37,6 +37,9 @@ installDepend() { "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install $DEPENDENCIES $COMPILEDEPS "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install libgcc_s1-gcc7-32bit glibc-devel-32bit ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add build-base multitail tar tree trash-cli unzip cmake jq + ;; *) "$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..927b34d4 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 ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 0a625913..2fe13ae2 100644 --- a/core/tabs/system-setup/system-cleanup.sh +++ b/core/tabs/system-setup/system-cleanup.sh @@ -25,6 +25,9 @@ cleanup_system() { "$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm "$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1 ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" cache clean + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" return 1 diff --git a/core/tabs/system-setup/system-update.sh b/core/tabs/system-setup/system-update.sh index c213156a..dba75ebb 100755 --- a/core/tabs/system-setup/system-update.sh +++ b/core/tabs/system-setup/system-update.sh @@ -48,6 +48,9 @@ fastUpdate() { "$ESCALATION_TOOL" "$PACKAGER" ref "$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" update + ;; *) printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" exit 1 @@ -74,6 +77,10 @@ updateSystem() { "$ESCALATION_TOOL" "$PACKAGER" ref "$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" upgrade + ;; *) printf "%b\n" "${RED}Unsupported package manager: "$PACKAGER"${RC}" exit 1 diff --git a/core/tabs/utils/encrypt_decrypt_tool.sh b/core/tabs/utils/encrypt_decrypt_tool.sh index 0db4a49b..86bd7a4c 100644 --- a/core/tabs/utils/encrypt_decrypt_tool.sh +++ b/core/tabs/utils/encrypt_decrypt_tool.sh @@ -19,6 +19,9 @@ if ! command_exists openssl; then zypper) "$ESCALATION_TOOL" "$PACKAGER" install openssl ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add openssl + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/utils/power-profile.sh b/core/tabs/utils/power-profile.sh index 536f7c69..1efdadcb 100644 --- a/core/tabs/utils/power-profile.sh +++ b/core/tabs/utils/power-profile.sh @@ -19,6 +19,9 @@ installAutoCpufreq() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm git ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add git + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y git ;; diff --git a/core/tabs/utils/samba-ssh-setup.sh b/core/tabs/utils/samba-ssh-setup.sh index 52004a27..07128105 100755 --- a/core/tabs/utils/samba-ssh-setup.sh +++ b/core/tabs/utils/samba-ssh-setup.sh @@ -11,6 +11,9 @@ install_package() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$PACKAGE" ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add $PACKAGE + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE" ;; @@ -34,6 +37,10 @@ setup_ssh() { install_package openssh SSH_SERVICE="sshd" ;; + apk) + install_package openssh + SSH_SERVICE="sshd" + ;; *) install_package openssh-server SSH_SERVICE="sshd" diff --git a/core/tabs/utils/timeshift.sh b/core/tabs/utils/timeshift.sh index afe2c71d..d78b1075 100644 --- a/core/tabs/utils/timeshift.sh +++ b/core/tabs/utils/timeshift.sh @@ -12,9 +12,11 @@ install_timeshift() { pacman) "$ESCALATION_TOOL" "${PACKAGER}" -S --noconfirm timeshift ;; - *) + dnf|zypper|apt-get|nala) "$ESCALATION_TOOL" "${PACKAGER}" install -y timeshift ;; + *) + printf "%b\n" "${RED}Unsupported pacakge manager.${RC}" esac else printf "%b\n" "${GREEN}Timeshift is already installed.${RC}" diff --git a/core/tabs/utils/utility_functions.sh b/core/tabs/utils/utility_functions.sh index b9ed3127..09f33c60 100755 --- a/core/tabs/utils/utility_functions.sh +++ b/core/tabs/utils/utility_functions.sh @@ -13,6 +13,9 @@ setup_xrandr() { apt-get|nala) "$ESCALATION_TOOL" "$PACKAGER" install -y x11-xserver-utils ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add 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 14faec0a..856c8a0f 100755 --- a/core/tabs/utils/wifi-control.sh +++ b/core/tabs/utils/wifi-control.sh @@ -13,6 +13,9 @@ setupNetworkManager() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y NetworkManager-1 ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add networkmanager-wifi iwd + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y network-manager ;; From 45a880ae9a7ddb8e8ec6fe110663de349565b7b8 Mon Sep 17 00:00:00 2001 From: Jeevitha Kannan K S Date: Sun, 13 Oct 2024 13:09:18 +0530 Subject: [PATCH 2/5] Add common service script --- core/tabs/applications-setup/docker-setup.sh | 8 +- core/tabs/common-service-script.sh | 85 ++++++++++++++++++++ core/tabs/utils/bluetooth-control.sh | 14 ++-- core/tabs/utils/numlock.sh | 10 ++- core/tabs/utils/ollama.sh | 2 +- core/tabs/utils/samba-ssh-setup.sh | 17 ++-- core/tabs/utils/timeshift.sh | 3 +- core/tabs/utils/wifi-control.sh | 11 ++- 8 files changed, 115 insertions(+), 35 deletions(-) create mode 100644 core/tabs/common-service-script.sh diff --git a/core/tabs/applications-setup/docker-setup.sh b/core/tabs/applications-setup/docker-setup.sh index 5ddc2257..74aa4983 100755 --- a/core/tabs/applications-setup/docker-setup.sh +++ b/core/tabs/applications-setup/docker-setup.sh @@ -1,10 +1,10 @@ #!/bin/sh -e . ../common-script.sh +. ../common-service-script.sh # Function to prompt the user for installation choice choose_installation() { - clear printf "%b\n" "${YELLOW}Choose what to install:${RC}" printf "%b\n" "1. ${YELLOW}Docker${RC}" printf "%b\n" "2. ${YELLOW}Docker Compose${RC}" @@ -28,13 +28,9 @@ install_docker() { ;; zypper) "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install docker - "$ESCALATION_TOOL" systemctl enable docker - "$ESCALATION_TOOL" systemctl start docker ;; pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm docker - "$ESCALATION_TOOL" systemctl enable docker - "$ESCALATION_TOOL" systemctl start docker ;; apk) "$ESCALATION_TOOL" "$PACKAGER" add docker @@ -44,6 +40,8 @@ install_docker() { exit 1 ;; esac + + startAndEnableService docker } install_docker_compose() { diff --git a/core/tabs/common-service-script.sh b/core/tabs/common-service-script.sh new file mode 100644 index 00000000..c3a2053d --- /dev/null +++ b/core/tabs/common-service-script.sh @@ -0,0 +1,85 @@ +#!/bin/sh -e + +checkInitManager() { + for manager in $1; do + if command_exists "$manager"; then + INIT_MANAGER="$manager" + printf "%b\n" "${CYAN}Using ${manager} to interact with init system${RC}" + break + fi + done + + if [ -z "$INIT_MANAGER" ]; then + printf "%b\n" "${RED}Can't find a supported init system${RC}" + exit 1 + fi +} + +startService() { + case "$INIT_MANAGER" in + systemctl) + "$ESCALATION_TOOL" "$INIT_MANAGER" start "$1" + ;; + rc-service) + "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start + ;; + esac +} + +stopService() { + case "$INIT_MANAGER" in + systemctl) + "$ESCALATION_TOOL" "$INIT_MANAGER" stop "$1" + ;; + rc-service) + "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop + ;; + esac +} + +enableService() { + case "$INIT_MANAGER" in + systemctl) + "$ESCALATION_TOOL" "$INIT_MANAGER" enable "$1" + ;; + rc-service) + "$ESCALATION_TOOL" rc-update add "$1" + ;; + esac +} + +disableService() { + case "$INIT_MANAGER" in + systemctl) + "$ESCALATION_TOOL" "$INIT_MANAGER" disable "$1" + ;; + rc-service) + "$ESCALATION_TOOL" rc-update del "$1" + ;; + esac +} + +startAndEnableService() { + case "$INIT_MANAGER" in + systemctl) + "$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1" + ;; + rc-service) + enableService "$1" + startService "$1" + ;; + esac +} + +isServiceActive() { + case "$INIT_MANAGER" in + systemctl) + "$ESCALATION_TOOL" "$INIT_MANAGER" is-active --quiet "$1" + ;; + rc-service) + "$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet + ;; + esac +} + +checkInitManager 'systemctl rc-service' \ No newline at end of file diff --git a/core/tabs/utils/bluetooth-control.sh b/core/tabs/utils/bluetooth-control.sh index da7ee23d..6bfe266b 100644 --- a/core/tabs/utils/bluetooth-control.sh +++ b/core/tabs/utils/bluetooth-control.sh @@ -1,6 +1,7 @@ #!/bin/sh -e . ../common-script.sh +. ../common-service-script.sh # Function to check Bluez is installed setupBluetooth() { @@ -10,6 +11,9 @@ setupBluetooth() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm bluez-utils ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add bluez + ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y bluez ;; @@ -18,15 +22,7 @@ setupBluetooth() { printf "%b\n" "${GREEN}Bluez is already installed.${RC}" fi - # Check if bluetooth service is running - if ! systemctl is-active --quiet bluetooth; then - printf "%b\n" "${YELLOW}Bluetooth service is not running. Starting it now...${RC}" - "$ESCALATION_TOOL" systemctl start bluetooth - - if systemctl is-active --quiet bluetooth; then - printf "%b\n" "${GREEN}Bluetooth service started successfully.${RC}" - fi - fi + startService bluetooth } # Function to display the main menu diff --git a/core/tabs/utils/numlock.sh b/core/tabs/utils/numlock.sh index 742ceeb7..6500a327 100755 --- a/core/tabs/utils/numlock.sh +++ b/core/tabs/utils/numlock.sh @@ -1,6 +1,7 @@ #!/bin/sh -e . ../common-script.sh +. ../common-service-script.sh # setleds can be used in all distros # This method works by calling a script using systemd service @@ -40,6 +41,11 @@ EOF numlockSetup() { # Check if the script and service files exists + if [ "$PACKAGER" = "apk" ]; then + printf "%b\n" "${RED}Unsupported package manager.${RC}" + exit 1 + fi + if [ ! -f "/usr/local/bin/numlock" ]; then create_file fi @@ -51,10 +57,10 @@ numlockSetup() { printf "%b" "Do you want to enable Numlock on boot? (y/N): " read -r confirm if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then - "$ESCALATION_TOOL" systemctl enable numlock.service --quiet + enableService numlock printf "%b\n" "Numlock will be enabled on boot" else - "$ESCALATION_TOOL" systemctl disable numlock.service --quiet + disableService numlock printf "%b\n" "Numlock will not be enabled on boot" fi } diff --git a/core/tabs/utils/ollama.sh b/core/tabs/utils/ollama.sh index 35453ba3..6c18374a 100644 --- a/core/tabs/utils/ollama.sh +++ b/core/tabs/utils/ollama.sh @@ -11,7 +11,7 @@ installollama() { else printf "%b\n" "${YELLOW}Installing ollama...${RC}" curl -fsSL https://ollama.com/install.sh | sh - "$ESCALATION_TOOL" systemctl start ollama + startService ollama fi } diff --git a/core/tabs/utils/samba-ssh-setup.sh b/core/tabs/utils/samba-ssh-setup.sh index 07128105..76b5f48e 100755 --- a/core/tabs/utils/samba-ssh-setup.sh +++ b/core/tabs/utils/samba-ssh-setup.sh @@ -47,17 +47,13 @@ setup_ssh() { ;; esac - # Enable and start the appropriate SSH service - "$ESCALATION_TOOL" systemctl enable "$SSH_SERVICE" - "$ESCALATION_TOOL" systemctl start "$SSH_SERVICE" + startAndEnableService "$SSH_SERVICE" - # Get the local IP address LOCAL_IP=$(ip -4 addr show | awk '/inet / {print $2}' | tail -n 1) printf "%b\n" "${GREEN}Your local IP address is: $LOCAL_IP${RC}" - # Check if SSH is running - if systemctl is-active --quiet "$SSH_SERVICE"; then + if isServiceActive "$SSH_SERVICE"; then printf "%b\n" "${GREEN}SSH is up and running.${RC}" else printf "%b\n" "${RED}Failed to start SSH.${RC}" @@ -137,12 +133,11 @@ setup_samba() { EOL fi - # Enable and start Samba services - "$ESCALATION_TOOL" systemctl enable smb nmb - "$ESCALATION_TOOL" systemctl start smb nmb + for service in smb nmb; do + startAndEnableService "$service" + done - # Check if Samba is running - if systemctl is-active --quiet smb && systemctl is-active --quiet nmb; then + if isServiceActive smb && isServiceActive nmb; then printf "%b\n" "${GREEN}Samba is up and running.${RC}" printf "%b\n" "${YELLOW}Samba share available at: $SHARED_DIR${RC}" else diff --git a/core/tabs/utils/timeshift.sh b/core/tabs/utils/timeshift.sh index d78b1075..b38483e5 100644 --- a/core/tabs/utils/timeshift.sh +++ b/core/tabs/utils/timeshift.sh @@ -16,7 +16,8 @@ install_timeshift() { "$ESCALATION_TOOL" "${PACKAGER}" install -y timeshift ;; *) - printf "%b\n" "${RED}Unsupported pacakge manager.${RC}" + printf "%b\n" "${RED}Unsupported package manager.${RC}" + ;; esac else printf "%b\n" "${GREEN}Timeshift is already installed.${RC}" diff --git a/core/tabs/utils/wifi-control.sh b/core/tabs/utils/wifi-control.sh index 856c8a0f..d4ed2d10 100755 --- a/core/tabs/utils/wifi-control.sh +++ b/core/tabs/utils/wifi-control.sh @@ -1,6 +1,7 @@ #!/bin/sh -e . ../common-script.sh +. ../common-service-script.sh # Function to check if NetworkManager is installed setupNetworkManager() { @@ -25,13 +26,11 @@ setupNetworkManager() { fi # Check if NetworkManager service is running - if ! systemctl is-active --quiet NetworkManager; then + if ! isServiceActive NetworkManager; then printf "%b\n" "${YELLOW}NetworkManager service is not running. Starting it now...${RC}" - "$ESCALATION_TOOL" systemctl start NetworkManager - - if systemctl is-active --quiet NetworkManager; then - printf "%b\n" "${GREEN}NetworkManager service started successfully.${RC}" - fi + startService NetworkManager + else + printf "%b\n" "${GREEN}NetworkManager service started successfully.${RC}" fi } From 73d05d6cfa4f20d641840ff7986535fe2bafc1ab Mon Sep 17 00:00:00 2001 From: Jeevitha Kannan K S Date: Sun, 13 Oct 2024 18:30:02 +0530 Subject: [PATCH 3/5] Fix alpine bugs --- .../tabs/applications-setup/Developer-tools/neovim-setup.sh | 2 +- core/tabs/applications-setup/browsers/librewolf.sh | 5 +++++ .../applications-setup/communication-apps/jitsi-setup.sh | 3 --- .../applications-setup/communication-apps/signal-setup.sh | 3 --- core/tabs/applications-setup/linutil-installer.sh | 2 -- core/tabs/applications-setup/linutil-updater.sh | 2 -- core/tabs/common-script.sh | 6 ++++++ core/tabs/system-setup/gaming-setup.sh | 5 ++++- core/tabs/system-setup/global-theme.sh | 5 +++++ core/tabs/system-setup/system-cleanup.sh | 5 ++++- 10 files changed, 25 insertions(+), 13 deletions(-) diff --git a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh index eaaa88f9..7b3a980c 100755 --- a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh @@ -30,7 +30,7 @@ installNeovim() { "$ESCALATION_TOOL" "$PACKAGER" install -y neovim ripgrep fzf python3-virtualenv luarocks golang ShellCheck git ;; apk) - "$ESCALATION_TOOL" "$PACKAGER" add neovim + "$ESCALATION_TOOL" "$PACKAGER" add neovim ripgrep fzf py3-virtualenv luarocks go shellcheck git ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" diff --git a/core/tabs/applications-setup/browsers/librewolf.sh b/core/tabs/applications-setup/browsers/librewolf.sh index 3320a68d..5562954e 100644 --- a/core/tabs/applications-setup/browsers/librewolf.sh +++ b/core/tabs/applications-setup/browsers/librewolf.sh @@ -33,6 +33,11 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/ "$AUR_HELPER" -S --needed --noconfirm librewolf-bin ;; apk) + alpine_version=$(grep . /etc/alpine-release | cut -d . -f 2) + if [ "$alpine_version" -le 20 ]; then + printf "%b\n" "${RED}Only available in edge release of alpine linux${RC}" + exit 1 + fi "$ESCALATION_TOOL" "$PACKAGER" add librewolf ;; *) diff --git a/core/tabs/applications-setup/communication-apps/jitsi-setup.sh b/core/tabs/applications-setup/communication-apps/jitsi-setup.sh index 72133e56..2b6b4bbe 100644 --- a/core/tabs/applications-setup/communication-apps/jitsi-setup.sh +++ b/core/tabs/applications-setup/communication-apps/jitsi-setup.sh @@ -21,9 +21,6 @@ installJitsi() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y jitsi-meet ;; - apk) - "$ESCALATION_TOOL" "$PACKAGER" add jitsi-meet - ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/communication-apps/signal-setup.sh b/core/tabs/applications-setup/communication-apps/signal-setup.sh index 00dec431..7f5d70fc 100644 --- a/core/tabs/applications-setup/communication-apps/signal-setup.sh +++ b/core/tabs/applications-setup/communication-apps/signal-setup.sh @@ -23,9 +23,6 @@ installSignal() { "$ESCALATION_TOOL" "$PACKAGER" copr enable luminoso/Signal-Desktop "$ESCALATION_TOOL" "$PACKAGER" install -y signal-desktop ;; - apk) - "$ESCALATION_TOOL" "$PACKAGER" add signal-desktop - ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/linutil-installer.sh b/core/tabs/applications-setup/linutil-installer.sh index e7e4d3d2..2107cb3a 100755 --- a/core/tabs/applications-setup/linutil-installer.sh +++ b/core/tabs/applications-setup/linutil-installer.sh @@ -47,8 +47,6 @@ installLinutil() { ;; apk) "$ESCALATION_TOOL" "$PACKAGER" add build-base - "$ESCALATION_TOOL" sed -i '/community/s/^#//' /etc/apk/repositories - "$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" add rustup rustup-init . $HOME/.cargo/env diff --git a/core/tabs/applications-setup/linutil-updater.sh b/core/tabs/applications-setup/linutil-updater.sh index 6c95fae5..b07219c9 100755 --- a/core/tabs/applications-setup/linutil-updater.sh +++ b/core/tabs/applications-setup/linutil-updater.sh @@ -21,8 +21,6 @@ updateLinutil() { ;; apk) "$ESCALATION_TOOL" "$PACKAGER" add build-base - "$ESCALATION_TOOL" sed -i '/community/s/^#//' /etc/apk/repositories - "$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" add rustup rustup-init ;; diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index ed83753a..56a7ecc0 100644 --- a/core/tabs/common-script.sh +++ b/core/tabs/common-script.sh @@ -82,6 +82,12 @@ checkPackageManager() { fi done + ## Enable apk community packages + if [ "$PACKAGER" = "apk" ] && grep -qE '^#.*community' /etc/apk/repositories; then + "$ESCALATION_TOOL" sed -i '/community/s/^#//' /etc/apk/repositories + "$ESCALATION_TOOL" "$PACKAGER" update + fi + if [ -z "$PACKAGER" ]; then printf "%b\n" "${RED}Can't find a supported package manager${RC}" exit 1 diff --git a/core/tabs/system-setup/gaming-setup.sh b/core/tabs/system-setup/gaming-setup.sh index 92c666c7..08b74f8f 100755 --- a/core/tabs/system-setup/gaming-setup.sh +++ b/core/tabs/system-setup/gaming-setup.sh @@ -50,7 +50,8 @@ installDepend() { "$ESCALATION_TOOL" "$PACKAGER" -n install $DEPENDENCIES ;; *) - "$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES + printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}" + exit 1 ;; esac } @@ -95,6 +96,8 @@ installAdditionalDepend() { "$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS ;; *) + printf "%b\n" "${RED}Unsupported package manager ${PACKAGER}${RC}" + exit 1 ;; esac } diff --git a/core/tabs/system-setup/global-theme.sh b/core/tabs/system-setup/global-theme.sh index 927b34d4..1acf7c93 100755 --- a/core/tabs/system-setup/global-theme.sh +++ b/core/tabs/system-setup/global-theme.sh @@ -18,6 +18,11 @@ install_theme_tools() { "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qt6ct kvantum ;; apk) + alpine_version=$(grep . /etc/alpine-release | cut -d . -f 2) + if [ "$alpine_version" -le 20 ]; then + printf "%b\n" "${RED}Only available in edge release of alpine linux${RC}" + exit 1 + fi "$ESCALATION_TOOL" "$PACKAGER" add qt6ct kvantum ;; *) diff --git a/core/tabs/system-setup/system-cleanup.sh b/core/tabs/system-setup/system-cleanup.sh index 2fe13ae2..f23d0638 100644 --- a/core/tabs/system-setup/system-cleanup.sh +++ b/core/tabs/system-setup/system-cleanup.sh @@ -1,6 +1,7 @@ #!/bin/sh -e . ../common-script.sh +. ../common-service-script.sh cleanup_system() { printf "%b\n" "${YELLOW}Performing system cleanup...${RC}" @@ -39,7 +40,9 @@ common_cleanup() { "$ESCALATION_TOOL" find /var/tmp -type f -atime +5 -delete "$ESCALATION_TOOL" find /tmp -type f -atime +5 -delete "$ESCALATION_TOOL" find /var/log -type f -name "*.log" -exec truncate -s 0 {} \; - "$ESCALATION_TOOL" journalctl --vacuum-time=3d + if [ "$INIT_MANAGER" = "systemctl" ]; then + "$ESCALATION_TOOL" journalctl --vacuum-time=3d + fi } clean_data() { From 5a1728e35023541c95b6f2a63669b40a59e22268 Mon Sep 17 00:00:00 2001 From: Jeevitha Kannan K S Date: Mon, 14 Oct 2024 09:49:09 +0530 Subject: [PATCH 4/5] Add flatpak installations --- .../tabs/applications-setup/Developer-tools/vscode-setup.sh | 6 +++++- .../applications-setup/Developer-tools/vscodium-setup.sh | 6 +++++- core/tabs/applications-setup/browsers/brave.sh | 6 +++++- core/tabs/applications-setup/browsers/thorium.sh | 1 + .../applications-setup/communication-apps/discord-setup.sh | 6 +++++- .../applications-setup/communication-apps/signal-setup.sh | 6 +++++- 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/core/tabs/applications-setup/Developer-tools/vscode-setup.sh b/core/tabs/applications-setup/Developer-tools/vscode-setup.sh index 018616a6..3a9c7f0e 100644 --- a/core/tabs/applications-setup/Developer-tools/vscode-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/vscode-setup.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installVsCode() { - if ! command_exists code; then + if ! command_exists com.visualstudio.code && ! command_exists code; then printf "%b\n" "${YELLOW}Installing VS Code..${RC}." case "$PACKAGER" in apt-get|nala) @@ -28,6 +28,10 @@ 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 ;; + apk) + checkFlatpak + flatpak install -y flathub com.visualstudio.code + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/Developer-tools/vscodium-setup.sh b/core/tabs/applications-setup/Developer-tools/vscodium-setup.sh index 5b5615ca..d6c97212 100644 --- a/core/tabs/applications-setup/Developer-tools/vscodium-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/vscodium-setup.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installVsCodium() { - if ! command_exists codium; then + if ! command_exists com.vscodium.codium && ! command_exists codium; then printf "%b\n" "${YELLOW}Installing VS Codium...${RC}" case "$PACKAGER" in apt-get|nala) @@ -26,6 +26,10 @@ installVsCodium() { printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/yum.repos.d/vscodium.repo "$ESCALATION_TOOL" "$PACKAGER" install -y codium ;; + apk) + checkFlatpak + flatpak install -y flathub com.vscodium.codium + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/browsers/brave.sh b/core/tabs/applications-setup/browsers/brave.sh index 8a7eab40..6618f0fe 100644 --- a/core/tabs/applications-setup/browsers/brave.sh +++ b/core/tabs/applications-setup/browsers/brave.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installBrave() { - if ! command_exists brave; then + if ! command_exists com.brave.Browser && ! command_exists brave; then printf "%b\n" "${YELLOW}Installing Brave...${RC}" case "$PACKAGER" in apt-get|nala) @@ -29,6 +29,10 @@ installBrave() { "$ESCALATION_TOOL" rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc "$ESCALATION_TOOL" "$PACKAGER" install -y brave-browser ;; + apk) + checkFlatpak + flatpak install -y flathub com.brave.Browser + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/browsers/thorium.sh b/core/tabs/applications-setup/browsers/thorium.sh index c45ebc80..dd0b20ef 100644 --- a/core/tabs/applications-setup/browsers/thorium.sh +++ b/core/tabs/applications-setup/browsers/thorium.sh @@ -22,6 +22,7 @@ installThrorium() { ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 ;; esac else diff --git a/core/tabs/applications-setup/communication-apps/discord-setup.sh b/core/tabs/applications-setup/communication-apps/discord-setup.sh index 6c7a0a83..f96bd9f2 100644 --- a/core/tabs/applications-setup/communication-apps/discord-setup.sh +++ b/core/tabs/applications-setup/communication-apps/discord-setup.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installDiscord() { - if ! command_exists discord; then + if ! command_exists com.discordapp.Discord && ! command_exists discord; then printf "%b\n" "${YELLOW}Installing Discord...${RC}" case "$PACKAGER" in apt-get|nala) @@ -20,6 +20,10 @@ 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) + checkFlatpak + flatpak install -y flathub com.discordapp.Discord + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/communication-apps/signal-setup.sh b/core/tabs/applications-setup/communication-apps/signal-setup.sh index 7f5d70fc..d7915152 100644 --- a/core/tabs/applications-setup/communication-apps/signal-setup.sh +++ b/core/tabs/applications-setup/communication-apps/signal-setup.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installSignal() { - if ! command_exists signal; then + if ! command_exists org.signal.Signal && ! command_exists signal; then printf "%b\n" "${YELLOW}Installing Signal...${RC}" case "$PACKAGER" in apt-get|nala) @@ -23,6 +23,10 @@ installSignal() { "$ESCALATION_TOOL" "$PACKAGER" copr enable luminoso/Signal-Desktop "$ESCALATION_TOOL" "$PACKAGER" install -y signal-desktop ;; + apk) + checkFlatpak + flatpak install -y flathub org.signal.Signal + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 From 9ed6fd563560f6b1f89d962c5f52f671bdd2b88c Mon Sep 17 00:00:00 2001 From: JEEVITHA KANNAN K S Date: Sun, 3 Nov 2024 19:33:18 +0530 Subject: [PATCH 5/5] chore: update scripts, add common-service-script to shellcheckrc --- .shellcheckrc | 3 ++- core/tabs/applications-setup/browsers/librewolf.sh | 10 +++------- core/tabs/applications-setup/browsers/waterfox.sh | 6 +++--- .../communication-apps/jitsi-setup.sh | 6 +++++- core/tabs/applications-setup/linutil-installer.sh | 3 ++- core/tabs/applications-setup/linutil-updater.sh | 2 ++ core/tabs/system-setup/global-theme.sh | 8 -------- core/tabs/system-setup/system-update.sh | 1 - core/tabs/utils/create-bootable-usb.sh | 3 +++ core/tabs/utils/samba-ssh-setup.sh | 2 +- 10 files changed, 21 insertions(+), 23 deletions(-) diff --git a/.shellcheckrc b/.shellcheckrc index 0b882066..6bf273ee 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -1,2 +1,3 @@ external-sources=true -source=core/tabs/common-script.sh \ No newline at end of file +source=core/tabs/common-script.sh +source=core/tabs/common-service-script.sh \ No newline at end of file diff --git a/core/tabs/applications-setup/browsers/librewolf.sh b/core/tabs/applications-setup/browsers/librewolf.sh index 5562954e..d8ed06b4 100644 --- a/core/tabs/applications-setup/browsers/librewolf.sh +++ b/core/tabs/applications-setup/browsers/librewolf.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installLibreWolf() { - if ! command_exists librewolf; then + if ! command_exists io.gitlab.librewolf-community && ! command_exists librewolf; then printf "%b\n" "${YELLOW}Installing Librewolf...${RC}" case "$PACKAGER" in apt-get|nala) @@ -33,12 +33,8 @@ Signed-By: /usr/share/keyrings/librewolf.gpg" | "$ESCALATION_TOOL" tee /etc/apt/ "$AUR_HELPER" -S --needed --noconfirm librewolf-bin ;; apk) - alpine_version=$(grep . /etc/alpine-release | cut -d . -f 2) - if [ "$alpine_version" -le 20 ]; then - printf "%b\n" "${RED}Only available in edge release of alpine linux${RC}" - exit 1 - fi - "$ESCALATION_TOOL" "$PACKAGER" add librewolf + checkFlatpak + flatpak install flathub io.gitlab.librewolf-community ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" diff --git a/core/tabs/applications-setup/browsers/waterfox.sh b/core/tabs/applications-setup/browsers/waterfox.sh index 3cef5106..28ec96dc 100644 --- a/core/tabs/applications-setup/browsers/waterfox.sh +++ b/core/tabs/applications-setup/browsers/waterfox.sh @@ -3,14 +3,14 @@ . ../../common-script.sh installWaterfox() { - if ! command_exists waterfox; then + if ! command_exists net.waterfox.waterfox && ! command_exists waterfox; then printf "%b\n" "${YELLOW}Installing waterfox...${RC}" case "$PACKAGER" in pacman) - "$AUR_HELPER" -S --needed --noconfirm waterfox-bin + "$AUR_HELPER" -S --needed --noconfirm waterfox-bin ;; *) - . ../setup-flatpak.sh + checkFlatpak flatpak install -y flathub net.waterfox.waterfox ;; esac diff --git a/core/tabs/applications-setup/communication-apps/jitsi-setup.sh b/core/tabs/applications-setup/communication-apps/jitsi-setup.sh index 2b6b4bbe..f6f2f200 100644 --- a/core/tabs/applications-setup/communication-apps/jitsi-setup.sh +++ b/core/tabs/applications-setup/communication-apps/jitsi-setup.sh @@ -3,7 +3,7 @@ . ../../common-script.sh installJitsi() { - if ! command_exists jitsi-meet; then + if ! command_exists org.jitsi.jitsi-meet && ! command_exists jitsi-meet; then printf "%b\n" "${YELLOW}Installing Jitsi meet...${RC}" case "$PACKAGER" in apt-get|nala) @@ -21,6 +21,10 @@ installJitsi() { dnf) "$ESCALATION_TOOL" "$PACKAGER" install -y jitsi-meet ;; + apk) + checkFlatpak + flatpak install flathub org.jitsi.jitsi-meet + ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/applications-setup/linutil-installer.sh b/core/tabs/applications-setup/linutil-installer.sh index 0531ca03..7b02af7c 100755 --- a/core/tabs/applications-setup/linutil-installer.sh +++ b/core/tabs/applications-setup/linutil-installer.sh @@ -49,7 +49,8 @@ installLinutil() { "$ESCALATION_TOOL" "$PACKAGER" add build-base "$ESCALATION_TOOL" "$PACKAGER" add rustup rustup-init - . $HOME/.cargo/env + # shellcheck disable=SC1091 + . "$HOME/.cargo/env" ;; *) curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/core/tabs/applications-setup/linutil-updater.sh b/core/tabs/applications-setup/linutil-updater.sh index b07219c9..4e399a02 100755 --- a/core/tabs/applications-setup/linutil-updater.sh +++ b/core/tabs/applications-setup/linutil-updater.sh @@ -23,6 +23,8 @@ updateLinutil() { "$ESCALATION_TOOL" "$PACKAGER" add build-base "$ESCALATION_TOOL" "$PACKAGER" add rustup rustup-init + # shellcheck disable=SC1091 + . "$HOME/.cargo/env" ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y rustup diff --git a/core/tabs/system-setup/global-theme.sh b/core/tabs/system-setup/global-theme.sh index 1acf7c93..07f9d4b2 100755 --- a/core/tabs/system-setup/global-theme.sh +++ b/core/tabs/system-setup/global-theme.sh @@ -17,14 +17,6 @@ install_theme_tools() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm qt6ct kvantum ;; - apk) - alpine_version=$(grep . /etc/alpine-release | cut -d . -f 2) - if [ "$alpine_version" -le 20 ]; then - printf "%b\n" "${RED}Only available in edge release of alpine linux${RC}" - exit 1 - fi - "$ESCALATION_TOOL" "$PACKAGER" add qt6ct kvantum - ;; *) printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" exit 1 diff --git a/core/tabs/system-setup/system-update.sh b/core/tabs/system-setup/system-update.sh index dba75ebb..53f3a1df 100755 --- a/core/tabs/system-setup/system-update.sh +++ b/core/tabs/system-setup/system-update.sh @@ -78,7 +78,6 @@ updateSystem() { "$ESCALATION_TOOL" "$PACKAGER" --non-interactive dup ;; apk) - "$ESCALATION_TOOL" "$PACKAGER" update "$ESCALATION_TOOL" "$PACKAGER" upgrade ;; *) diff --git a/core/tabs/utils/create-bootable-usb.sh b/core/tabs/utils/create-bootable-usb.sh index f05830d3..09b24d4d 100644 --- a/core/tabs/utils/create-bootable-usb.sh +++ b/core/tabs/utils/create-bootable-usb.sh @@ -12,6 +12,7 @@ list_devices() { printf "\n" } +# shellcheck disable=SC2086 installDependencies() { DEPENDENCIES="xz gzip bzip2 jq" if ! command_exists ${DEPENDENCIES}; then @@ -23,6 +24,8 @@ installDependencies() { "${ESCALATION_TOOL}" "${PACKAGER}" install -y ${DEPENDENCIES};; pacman) "${ESCALATION_TOOL}" "${PACKAGER}" -S --noconfirm --needed ${DEPENDENCIES};; + apk) + "${ESCALATION_TOOL}" "${PACKAGER}" add ${DEPENDENCIES};; *) printf "%b\n" "${RED}Unsupported package manager.${RC}" exit 1 diff --git a/core/tabs/utils/samba-ssh-setup.sh b/core/tabs/utils/samba-ssh-setup.sh index 76b5f48e..aa0dc30e 100755 --- a/core/tabs/utils/samba-ssh-setup.sh +++ b/core/tabs/utils/samba-ssh-setup.sh @@ -12,7 +12,7 @@ install_package() { "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$PACKAGE" ;; apk) - "$ESCALATION_TOOL" "$PACKAGER" add $PACKAGE + "$ESCALATION_TOOL" "$PACKAGER" add "$PACKAGE" ;; *) "$ESCALATION_TOOL" "$PACKAGER" install -y "$PACKAGE"