From 054acfab1ed5ad6e161a3ed7ea9d3e51b0ce3ba2 Mon Sep 17 00:00:00 2001 From: hexisXz Date: Mon, 30 Sep 2024 03:59:05 +0000 Subject: [PATCH] added waterfox browser --- .../applications-setup/browsers/waterfox.sh | 51 +++++++++---------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/core/tabs/applications-setup/browsers/waterfox.sh b/core/tabs/applications-setup/browsers/waterfox.sh index 2ba58cab..48b6e784 100644 --- a/core/tabs/applications-setup/browsers/waterfox.sh +++ b/core/tabs/applications-setup/browsers/waterfox.sh @@ -1,37 +1,32 @@ #!/bin/sh -e - . ../../common-script.sh - -buildWaterfox() { - wget -O waterfox.tar.bz2 "https://cdn1.waterfox.net/waterfox/releases/latest/linux" && tar -xvjf waterfox.tar.bz2 -C ./ && rm waterfox.tar.bz2 ; sudo mkdir -p /opt/waterfox && sudo mv waterfox /opt/waterfox && cd /opt/waterfox/waterfox && sudo ln -s /opt/waterfox/waterfox/waterfox /usr/bin/waterfox -} - - installWaterfox() { - if ! command_exists waterfox; then - printf "%b\n" "${YELLOW}Installing waterfox...${RC}" - case "$PACKAGER" in - apt-get|nala) - "$ESCALATION_TOOL" "$PACKAGER" install -y wget && buildWaterfox - ;; - zypper) - "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install wget && buildWaterfox - ;; - pacman) - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm wget && buildWaterfox - ;; - dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y wget && buildWaterfox - ;; - *) - printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" - exit 1 - ;; -esac + buildWaterfox=$(curl -L -o waterfox.tar.bz2 "https://cdn1.waterfox.net/waterfox/releases/latest/linux" && tar -xvjf waterfox.tar.bz2 -C ./ && rm waterfox.tar.bz2 ; sudo mkdir -p /opt/waterfox && sudo mv waterfox /opt/waterfox && cd /opt/waterfox/waterfox && sudo ln -s /opt/waterfox/waterfox/waterfox /usr/bin/waterfox) + + if ! command_exists firefox; then + printf "%b\n" "${YELLOW}Installing waterfox...${RC}" + case "$PACKAGER" in + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" install -y curl && printf("$buildWaterfox") + ;; + zypper) + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install curl && printf("$buildWaterfox") + ;; + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm curl && printf("$buildWaterfox") + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y curl && printf("$buildWaterfox") + ;; + *) + printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}" + exit 1 + ;; + esac else - printf "%b\n" "${GREEN}waterfox is already installed.${RC}" + printf "%b\n" "${GREEN}Waterfox Browser is already installed.${RC}" fi }