From 55587dfe4b0e6ad50db1d955cc515e7889fef56e Mon Sep 17 00:00:00 2001 From: Fr4nz D13trich Date: Sun, 21 Dec 2025 12:05:50 +0100 Subject: [PATCH] Removal option added; Help page extended --- README.md | 6 +- config/helium.desktop | 23 ++++++++ {icon => config/icon}/helium-icon.png | Bin helium_helper.sh | 76 ++++++++++++++++++++++---- todo.md | 16 ++++-- 5 files changed, 100 insertions(+), 21 deletions(-) create mode 100644 config/helium.desktop rename {icon => config/icon}/helium-icon.png (100%) diff --git a/README.md b/README.md index 6f333c9..8b79e1d 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ ## Overview ### Helium_Helper.sh - Interactive installer and updater script -- Installs to `/home//.apps/Helium` | changeable in line 15 `INSTALL_PATH` +- Installs to `/home//.apps/Helium` | changeable in line 16 `INSTALL_PATH` - Assumes: - - Presence of `/home//.apps/Helium` when updating | changeable in line 15 `INSTALL_PATH` + - Presence of `/home//.apps/Helium` when updating | changeable in line 16 `INSTALL_PATH` - Executable named `helium-browser.AppImage` | for convenience so launchers don't have to be edited at each update - Keeps prior AppImage as `helium-browser.OldAppImage` which will be replaced at every update ### Helium_Auto_Update.sh -- Automatic updater script for e.g. `cron` +- Automatic updater script - Installs to `/home//.apps/Helium` | changeable in line 8 `INSTALL_PATH` - Assumes: - Presence of `/home//.apps/Helium` when updating | changeable in line 8 `INSTALL_PATH` diff --git a/config/helium.desktop b/config/helium.desktop new file mode 100644 index 0000000..afb0025 --- /dev/null +++ b/config/helium.desktop @@ -0,0 +1,23 @@ +[Desktop Entry] +Version=1.0 +Name=Helium Browser +GenericName=Web Browser +Comment=Access the Internet +Exec=EXEC_PATH %U +StartupNotify=true +StartupWMClass=helium +Terminal=false +Icon=ICON_PATH +Type=Application +Categories=Network;WebBrowser; +MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; +Actions=new-window;new-private-window; +X-AppImage-Version=VERSION + +[Desktop Action new-window] +Name=New Window +Exec=EXEC_PATH + +[Desktop Action new-private-window] +Name=New Incognito Window +Exec=EXEC_PATH --incognito diff --git a/icon/helium-icon.png b/config/icon/helium-icon.png similarity index 100% rename from icon/helium-icon.png rename to config/icon/helium-icon.png diff --git a/helium_helper.sh b/helium_helper.sh index cfb0379..6212b2c 100755 --- a/helium_helper.sh +++ b/helium_helper.sh @@ -12,14 +12,16 @@ GRN="\e[0;32m" CRS="\e[0m" ## LOCATIONS -mkdir -p /tmp/Helium TMP=/tmp/Helium INSTALL_PATH=$HOME/.apps/Helium +CONFIG_PATH=$INSTALL_PATH/config +LAUNCHER_PATH=$HOME/.local/share/applications +SCRIPT_PATH=$HOME/.local/bin #PROFILE=$HOME/.profile ### for AUTO UPDATE ## GLOBAL VARIABLES SCRIPT_NAME="Helium Helper Script" -SCRIPT_VERSION="0.5" +SCRIPT_VERSION="0.5.1" DEPENDENCIES=("curl" "wget") MISSING=$(cat $TMP/missingDeps 2>/dev/null) GIT_VERSION=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "tag_name" | tr -d \", | awk '{print $2}') @@ -58,7 +60,6 @@ dependency_check() { ### CHECK LOCAL INSTALL local_check() { - if ! [ -d "$INSTALL_PATH" ] ; then echo -e "\n ${RED}Helium directory not found!${CRS}" install_helium @@ -77,11 +78,10 @@ local_check() { ### INSTALL install_helium() { - if [ -f "$INSTALL_PATH/helium-browser.AppImage" ] ; then echo -e "\n ${CYN}Helium AppImage found! Trying to update...${CRS}" update_helium - exit 1 + exit 0 else : @@ -94,12 +94,13 @@ install_helium() { if [[ "$CONFIRM_INSTALL" == "" || "$CONFIRM_INSTALL" == "y" || "$CONFIRM_INSTALL" == "Y" ]] ; then GIT_URL=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "browser_download_url" | grep "x86_64.AppImage" | grep -v "zsync" | tr -d \" | awk '{print $2}') GIT_FILENAME=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "browser_download_url" | grep "x86_64.AppImage" | grep -v "zsync" | tr -d \" | awk '{print $2}' | awk -F'/' '{print $9}') + mkdir -p $TMP wget -P $TMP $GIT_URL -q --show-progress chmod +x $TMP/$GIT_FILENAME mkdir -p $INSTALL_PATH mv $TMP/$GIT_FILENAME $INSTALL_PATH/helium-browser.AppImage echo -e "\n ${GRN}Helium is installed!${CRS}\n" - rm -rf $TMP + clean_tmp exit 0 elif [[ "$CONFIRM_INSTALL" == "n" || "$CONFIRM_INSTALL" == "N" ]] ; then @@ -150,6 +151,7 @@ update_helium() { if [[ "$CONFIRM" == "" || "$CONFIRM" == "y" || "$CONFIRM" == "Y" ]] ; then GIT_URL=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "browser_download_url" | grep "x86_64.AppImage" | grep -v "zsync" | tr -d \" | awk '{print $2}') GIT_FILENAME=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "browser_download_url" | grep "x86_64.AppImage" | grep -v "zsync" | tr -d \" | awk '{print $2}' | awk -F'/' '{print $9}') + mkdir -p $TMP wget -P $TMP $GIT_URL -q --show-progress chmod +x $TMP/$GIT_FILENAME rm $INSTALL_PATH/helium-browser.OldAppImage >/dev/null 2>&1 @@ -180,6 +182,36 @@ update_helium() { } +### REMOVE +remove_helium() { + if [ -d "$INSTALL_PATH" ] ; then + + while true ; do + read -p " Remove Helium folder ${INSTALL_PATH}? (Y/n) : " CONFIRM_REMOVE + + if [[ "$CONFIRM_REMOVE" == "" || "$CONFIRM_REMOVE" == "y" || "$CONFIRM_REMOVE" == "Y" ]] ; then + rm -rf $INSTALL_PATH + echo -e "\n ${RED}Helium removed!${CRS}\n" + exit 0 + + elif [[ "$CONFIRM_REMOVE" == "n" || "$CONFIRM_REMOVE" == "N" ]] ; then + echo -e "\n ${RED}Removal cancelled!${CRS}\n" + exit 0 + + else + echo -e " ${YEL}Invalid response!${CRS}\n" + + fi + + done + + else + echo -e "\n ${RED}Can't remove Helium! ${YEL}${INSTALL_PATH} ${RED}directory not found...${CRS}\n" + exit 1 + + fi +} + ### SCRIPT VERSION script_version() { echo -e "\n ${CYN}Helium Helper Script Version : ${GRN}${SCRIPT_VERSION}${CRS}\n" @@ -213,12 +245,14 @@ compare_version() { echo -e "\n ${GRN}Helium is up-to-date!${CRS}\n" echo -e " ${CYN}Local Version :\t${CRS}${LOCAL_VERSION}" echo -e " ${CYN}GitHub Version :\t${CRS}${GIT_VERSION}\n" - + exit 0 + elif [ "$GIT_VERSION_NUM" -gt "$LOCAL_VERSION_NUM" ] ; then echo -e "\n ${YEL}Helium is updatable!${CRS}\n" echo -e " ${CYN}Local Version :\t${CRS}${LOCAL_VERSION}" echo -e " ${CYN}GitHub Version :\t${CRS}${GIT_VERSION}\n" - + exit 0 + else echo -e "\n ${RED}Version tags malformed or you are using a Beta version!${CRS}\n" echo -e " ${CYN}Local Version :\t${CRS}${LOCAL_VERSION}" @@ -234,29 +268,46 @@ help() { echo -e "\n${CYN}${SCRIPT_NAME}${CRS}\n" echo -e "Helium Browser installer & updater script\n" echo -e "Syntax: helium_helper.sh [ -i | -u | -c | -s | -h ]\n" - echo -e "Options :\n" - echo -e "\t-i\tInstall Helium to ${GRN}${INSTALL_PATH}${CRS}" + echo -e "Options:\n" + echo -e "\t-i\tDownload & install Helium from GitHub" echo -e "\t-u\tUpdate Helium from GitHub" + echo -e "\t-r\tRemove Helium" echo -e "\t-c\tCompare local to remote version" echo -e "\t-s\tShow script version" echo -e "\t-h\tPrint this help page.\n" + echo -e "Configured locations:\n" + echo -e "\t${GRN}${INSTALL_PATH}${CRS}\t\tInstall directory" + echo -e "\t${GRN}${LAUNCHER_PATH}${CRS}\tLauncher directory" + echo -e "\t${GRN}${SCRIPT_PATH}${CRS}\t\t\tScript location\n" +} + +### CLEAN +clean_tmp() { + rm -rf $TMP } ########## MAIN ########## ## GET OPTIONS -while getopts ":i,:u,:c,:s,:h" OPTION ; do +while getopts ":i,:u,:r,:c,:s,:h" OPTION ; do case $OPTION in i) echo -e "\n ${YEL}Installing Helium Browser...${CRS}" dependency_check install_helium + clean_tmp exit ;; u) echo -e "\n ${YEL}Updating Helium Browser...${CRS}" dependency_check update_helium + clean_tmp + exit ;; + + r) + echo -e "\n ${YEL}Removing Helium Browser...${CRS}" + remove_helium exit ;; c) @@ -286,6 +337,7 @@ local_check ## UPDATE update_helium -rm -rf $TMP +## CLEAN +clean_tmp exit 0 diff --git a/todo.md b/todo.md index b85c3d4..680e9e0 100644 --- a/todo.md +++ b/todo.md @@ -1,16 +1,18 @@ # To Do List Helium installer -## Last Job -- Added functionality to Version comparasing - -## Fix -- Auto Update implementation +## Last Jobs +- Improved Version comparasing +- Added options [ -i | -u | -c | -s | -h ] +- Pre - Released Version 0.5 ## Add - Internet connectivity check in [Auto Update Script](https://lab.c95.org/fr4nz/shell-scripts/src/branch/main/helium-browser/helium_auto_update.sh) - Desktop entry [Helper Script](https://lab.c95.org/fr4nz/shell-scripts/src/branch/main/helium-browser/helium_helper.sh) - Desktop entry updater [Helper Script](https://lab.c95.org/fr4nz/shell-scripts/src/branch/main/helium-browser/helium_helper.sh) & [Auto Update Script](https://lab.c95.org/fr4nz/shell-scripts/src/branch/main/helium-browser/helium_auto_update.sh) -- create help function +- Script updater +- Architecture detection +- Uninstaller --> Partially done +- Set alias ## Repo - Merge workflow @@ -18,6 +20,8 @@ - Remove to do list - Remove comment from script +## Fix + ## Notes ```sh