Removal option added; Help page extended

This commit is contained in:
Fr4nz D13trich 2025-12-21 12:05:50 +01:00
parent dc690e80b7
commit 55587dfe4b
5 changed files with 100 additions and 21 deletions

View file

@ -2,14 +2,14 @@
## Overview ## Overview
### Helium_Helper.sh ### Helium_Helper.sh
- Interactive installer and updater script - Interactive installer and updater script
- Installs to `/home/<USER>/.apps/Helium` | changeable in line 15 `INSTALL_PATH` - Installs to `/home/<USER>/.apps/Helium` | changeable in line 16 `INSTALL_PATH`
- Assumes: - Assumes:
- Presence of `/home/<USER>/.apps/Helium` when updating | changeable in line 15 `INSTALL_PATH` - Presence of `/home/<USER>/.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 - 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 - Keeps prior AppImage as `helium-browser.OldAppImage` which will be replaced at every update
### Helium_Auto_Update.sh ### Helium_Auto_Update.sh
- Automatic updater script for e.g. `cron` - Automatic updater script
- Installs to `/home/<USER>/.apps/Helium` | changeable in line 8 `INSTALL_PATH` - Installs to `/home/<USER>/.apps/Helium` | changeable in line 8 `INSTALL_PATH`
- Assumes: - Assumes:
- Presence of `/home/<USER>/.apps/Helium` when updating | changeable in line 8 `INSTALL_PATH` - Presence of `/home/<USER>/.apps/Helium` when updating | changeable in line 8 `INSTALL_PATH`

23
config/helium.desktop Normal file
View file

@ -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

View file

Before

Width:  |  Height:  |  Size: 371 KiB

After

Width:  |  Height:  |  Size: 371 KiB

Before After
Before After

View file

@ -12,14 +12,16 @@ GRN="\e[0;32m"
CRS="\e[0m" CRS="\e[0m"
## LOCATIONS ## LOCATIONS
mkdir -p /tmp/Helium
TMP=/tmp/Helium TMP=/tmp/Helium
INSTALL_PATH=$HOME/.apps/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 #PROFILE=$HOME/.profile ### for AUTO UPDATE
## GLOBAL VARIABLES ## GLOBAL VARIABLES
SCRIPT_NAME="Helium Helper Script" SCRIPT_NAME="Helium Helper Script"
SCRIPT_VERSION="0.5" SCRIPT_VERSION="0.5.1"
DEPENDENCIES=("curl" "wget") DEPENDENCIES=("curl" "wget")
MISSING=$(cat $TMP/missingDeps 2>/dev/null) 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}') 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 ### CHECK LOCAL INSTALL
local_check() { local_check() {
if ! [ -d "$INSTALL_PATH" ] ; then if ! [ -d "$INSTALL_PATH" ] ; then
echo -e "\n ${RED}Helium directory not found!${CRS}" echo -e "\n ${RED}Helium directory not found!${CRS}"
install_helium install_helium
@ -77,11 +78,10 @@ local_check() {
### INSTALL ### INSTALL
install_helium() { install_helium() {
if [ -f "$INSTALL_PATH/helium-browser.AppImage" ] ; then if [ -f "$INSTALL_PATH/helium-browser.AppImage" ] ; then
echo -e "\n ${CYN}Helium AppImage found! Trying to update...${CRS}" echo -e "\n ${CYN}Helium AppImage found! Trying to update...${CRS}"
update_helium update_helium
exit 1 exit 0
else else
: :
@ -94,12 +94,13 @@ install_helium() {
if [[ "$CONFIRM_INSTALL" == "" || "$CONFIRM_INSTALL" == "y" || "$CONFIRM_INSTALL" == "Y" ]] ; then 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_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}') 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 wget -P $TMP $GIT_URL -q --show-progress
chmod +x $TMP/$GIT_FILENAME chmod +x $TMP/$GIT_FILENAME
mkdir -p $INSTALL_PATH mkdir -p $INSTALL_PATH
mv $TMP/$GIT_FILENAME $INSTALL_PATH/helium-browser.AppImage mv $TMP/$GIT_FILENAME $INSTALL_PATH/helium-browser.AppImage
echo -e "\n ${GRN}Helium is installed!${CRS}\n" echo -e "\n ${GRN}Helium is installed!${CRS}\n"
rm -rf $TMP clean_tmp
exit 0 exit 0
elif [[ "$CONFIRM_INSTALL" == "n" || "$CONFIRM_INSTALL" == "N" ]] ; then elif [[ "$CONFIRM_INSTALL" == "n" || "$CONFIRM_INSTALL" == "N" ]] ; then
@ -150,6 +151,7 @@ update_helium() {
if [[ "$CONFIRM" == "" || "$CONFIRM" == "y" || "$CONFIRM" == "Y" ]] ; then 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_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}') 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 wget -P $TMP $GIT_URL -q --show-progress
chmod +x $TMP/$GIT_FILENAME chmod +x $TMP/$GIT_FILENAME
rm $INSTALL_PATH/helium-browser.OldAppImage >/dev/null 2>&1 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
script_version() { script_version() {
echo -e "\n ${CYN}Helium Helper Script Version : ${GRN}${SCRIPT_VERSION}${CRS}\n" echo -e "\n ${CYN}Helium Helper Script Version : ${GRN}${SCRIPT_VERSION}${CRS}\n"
@ -213,11 +245,13 @@ compare_version() {
echo -e "\n ${GRN}Helium is up-to-date!${CRS}\n" echo -e "\n ${GRN}Helium is up-to-date!${CRS}\n"
echo -e " ${CYN}Local Version :\t${CRS}${LOCAL_VERSION}" echo -e " ${CYN}Local Version :\t${CRS}${LOCAL_VERSION}"
echo -e " ${CYN}GitHub Version :\t${CRS}${GIT_VERSION}\n" echo -e " ${CYN}GitHub Version :\t${CRS}${GIT_VERSION}\n"
exit 0
elif [ "$GIT_VERSION_NUM" -gt "$LOCAL_VERSION_NUM" ] ; then elif [ "$GIT_VERSION_NUM" -gt "$LOCAL_VERSION_NUM" ] ; then
echo -e "\n ${YEL}Helium is updatable!${CRS}\n" echo -e "\n ${YEL}Helium is updatable!${CRS}\n"
echo -e " ${CYN}Local Version :\t${CRS}${LOCAL_VERSION}" echo -e " ${CYN}Local Version :\t${CRS}${LOCAL_VERSION}"
echo -e " ${CYN}GitHub Version :\t${CRS}${GIT_VERSION}\n" echo -e " ${CYN}GitHub Version :\t${CRS}${GIT_VERSION}\n"
exit 0
else else
echo -e "\n ${RED}Version tags malformed or you are using a Beta version!${CRS}\n" echo -e "\n ${RED}Version tags malformed or you are using a Beta version!${CRS}\n"
@ -234,29 +268,46 @@ help() {
echo -e "\n${CYN}${SCRIPT_NAME}${CRS}\n" echo -e "\n${CYN}${SCRIPT_NAME}${CRS}\n"
echo -e "Helium Browser installer & updater script\n" echo -e "Helium Browser installer & updater script\n"
echo -e "Syntax: helium_helper.sh [ -i | -u | -c | -s | -h ]\n" echo -e "Syntax: helium_helper.sh [ -i | -u | -c | -s | -h ]\n"
echo -e "Options :\n" echo -e "Options:\n"
echo -e "\t-i\tInstall Helium to ${GRN}${INSTALL_PATH}${CRS}" echo -e "\t-i\tDownload & install Helium from GitHub"
echo -e "\t-u\tUpdate 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-c\tCompare local to remote version"
echo -e "\t-s\tShow script version" echo -e "\t-s\tShow script version"
echo -e "\t-h\tPrint this help page.\n" 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 ########## ########## MAIN ##########
## GET OPTIONS ## GET OPTIONS
while getopts ":i,:u,:c,:s,:h" OPTION ; do while getopts ":i,:u,:r,:c,:s,:h" OPTION ; do
case $OPTION in case $OPTION in
i) i)
echo -e "\n ${YEL}Installing Helium Browser...${CRS}" echo -e "\n ${YEL}Installing Helium Browser...${CRS}"
dependency_check dependency_check
install_helium install_helium
clean_tmp
exit ;; exit ;;
u) u)
echo -e "\n ${YEL}Updating Helium Browser...${CRS}" echo -e "\n ${YEL}Updating Helium Browser...${CRS}"
dependency_check dependency_check
update_helium update_helium
clean_tmp
exit ;;
r)
echo -e "\n ${YEL}Removing Helium Browser...${CRS}"
remove_helium
exit ;; exit ;;
c) c)
@ -286,6 +337,7 @@ local_check
## UPDATE ## UPDATE
update_helium update_helium
rm -rf $TMP ## CLEAN
clean_tmp
exit 0 exit 0

16
todo.md
View file

@ -1,16 +1,18 @@
# To Do List Helium installer # To Do List Helium installer
## Last Job ## Last Jobs
- Added functionality to Version comparasing - Improved Version comparasing
- Added options [ -i | -u | -c | -s | -h ]
## Fix - Pre - Released Version 0.5
- Auto Update implementation
## Add ## Add
- Internet connectivity check in [Auto Update Script](https://lab.c95.org/fr4nz/shell-scripts/src/branch/main/helium-browser/helium_auto_update.sh) - 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 [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) - 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 ## Repo
- Merge workflow - Merge workflow
@ -18,6 +20,8 @@
- Remove to do list - Remove to do list
- Remove comment from script - Remove comment from script
## Fix
## Notes ## Notes
```sh ```sh