From d4c7480d1eb742f871432954632970998fc16bdb Mon Sep 17 00:00:00 2001 From: Gun <6913739+GunGunGun@users.noreply.github.com> Date: Fri, 1 Nov 2024 21:14:51 +0700 Subject: [PATCH 1/4] Install Native Package Bash Script Install Native Package Bash Script --- install.sh | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..a1d45d2 --- /dev/null +++ b/install.sh @@ -0,0 +1,116 @@ +#!/bin/bash + +app_name=zen +literal_name_of_installation_directory=".tarball-installations" +universal_path_for_installation_directory="$HOME/$literal_name_of_installation_directory" +app_installation_directory="$universal_path_for_installation_directory/zen" +official_package_location="https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-generic.tar.bz2" +tar_location=$(mktemp /tmp/zen.XXXXXX.tar.bz2) +open_tar_application_data_location="zen" +local_bin_path="$HOME/.local/bin" +local_application_path="$HOME/.local/share/applications" +app_bin_in_local_bin="$local_bin_path/$app_name" +desktop_in_local_applications="$local_application_path/$app_name.desktop" +icon_path="$app_installation_directory/browser/chrome/icons/default/default128.png" +executable_path=$app_installation_directory/zen + +echo "Welcome to Zen tarball installer, just chill and wait for the installation to complete!" + +sleep 1 + +echo "Checking to see if an older installation exists" +if [ -f "$app_bin_in_local_bin" ]; then + echo "Old bin file detected, removing..." + rm "$app_bin_in_local_bin" +fi + +if [ -d "$app_installation_directory" ]; then + echo "Old app files are found, removing..." + rm -rf "$app_installation_directory" +fi + +if [ -f "$desktop_in_local_applications" ]; then + echo "Old app files are found, removing..." + rm "$desktop_in_local_applications" +fi + +sleep 1 + +echo "Installing the latest package" +curl -L -o $tar_location $official_package_location +if [ $? -eq 0 ]; then + echo OK +else + echo "Installation failed. Curl not found or not installed" + exit +fi + +tar -xvjf $tar_location + +echo "Installed and untarred successfully" + +if [ ! -d $universal_path_for_installation_directory ]; then + echo "Creating the $universal_path_for_installation_directory directory for installation" + mkdir $universal_path_for_installation_directory +fi + +mv $open_tar_application_data_location $app_installation_directory + +echo "Zen successfully moved to your safe place!" + +rm $tar_location + +if [ ! -d $local_bin_path ]; then + echo "$local_bin_path not found, creating it for you" + mkdir $local_bin_path +fi + +touch $app_bin_in_local_bin +chmod u+x $app_bin_in_local_bin +echo "#!/bin/bash +$executable_path" >> $app_bin_in_local_bin + +echo "Created executable for your \$PATH if you ever need" + +if [ ! -d $local_application_path ]; then + echo "Creating the $local_application_path directory for desktop file" + mkdir $local_application_path +fi + + +touch $desktop_in_local_applications +echo " +[Desktop Entry] +Name=Zen +Keywords=web;browser;internet +Exec=$executable_path %u +Icon=$icon_path +Terminal=false +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; +Categories=Network;WebBrowser; +Actions=new-window;new-private-window;profile-manager-window; +[Desktop Action new-window] +Name=Open a New Window +Exec=$executable_path --new-window %u +[Desktop Action new-private-window] +Name=Open a New Private Window +Exec=$executable_path --private-window %u +[Desktop Action profile-manager-window] +Name=Open the Profile Manager +Exec=$executable_path --ProfileManager +" >> $desktop_in_local_applications + +echo "Created desktop entry successfully" + +sleep 1 + +echo "Installation is successful" + +sleep 1 + +echo "Done, and done, have fun!" + +sleep 1 + +exit 0 From 3d778bd429a0687e9373ad069a6fe6c47dcd5e59 Mon Sep 17 00:00:00 2001 From: Gun <6913739+GunGunGun@users.noreply.github.com> Date: Sun, 10 Nov 2024 19:18:55 +0700 Subject: [PATCH 2/4] Auto detect generic and specific --- install.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a1d45d2..2bfa91c 100644 --- a/install.sh +++ b/install.sh @@ -4,7 +4,9 @@ app_name=zen literal_name_of_installation_directory=".tarball-installations" universal_path_for_installation_directory="$HOME/$literal_name_of_installation_directory" app_installation_directory="$universal_path_for_installation_directory/zen" -official_package_location="https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-generic.tar.bz2" +official_package_location_generic="https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-generic.tar.bz2" +official_package_location_specific="https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-specific.tar.bz2" +official_package_location="$official_package_location_generic" tar_location=$(mktemp /tmp/zen.XXXXXX.tar.bz2) open_tar_application_data_location="zen" local_bin_path="$HOME/.local/bin" @@ -14,6 +16,19 @@ desktop_in_local_applications="$local_application_path/$app_name.desktop" icon_path="$app_installation_directory/browser/chrome/icons/default/default128.png" executable_path=$app_installation_directory/zen +# Function to check if AVX2 is supported +check_avx2_support() { + if grep -q avx2 /proc/cpuinfo; then + return 0 # AVX2 supported + else + return 1 # AVX2 not supported + fi +} + +if check_avx2_support; then + official_package_location="$official_package_location_specific" +fi + echo "Welcome to Zen tarball installer, just chill and wait for the installation to complete!" sleep 1 From 332b02c4beb78b62dc0398d6de0f5cfaf9bc9594 Mon Sep 17 00:00:00 2001 From: Gun <6913739+GunGunGun@users.noreply.github.com> Date: Mon, 11 Nov 2024 21:56:29 +0700 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🐷 --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 2bfa91c..faf0258 100644 --- a/install.sh +++ b/install.sh @@ -124,7 +124,7 @@ echo "Installation is successful" sleep 1 -echo "Done, and done, have fun!" +echo "Done, and done, have fun! 🐷" sleep 1 From b1a0237216a01e18c8bfb8e55725ef5950a5463f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?mr=2E=20m=20=20=F0=9F=A4=99?= <91018726+mauro-balades@users.noreply.github.com> Date: Wed, 13 Nov 2024 23:10:23 +0100 Subject: [PATCH 4/4] Update install.sh --- install.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/install.sh b/install.sh index faf0258..17e5e1f 100644 --- a/install.sh +++ b/install.sh @@ -49,8 +49,6 @@ if [ -f "$desktop_in_local_applications" ]; then rm "$desktop_in_local_applications" fi -sleep 1 - echo "Installing the latest package" curl -L -o $tar_location $official_package_location if [ $? -eq 0 ]; then @@ -117,15 +115,7 @@ Exec=$executable_path --ProfileManager " >> $desktop_in_local_applications echo "Created desktop entry successfully" - -sleep 1 - echo "Installation is successful" - -sleep 1 - echo "Done, and done, have fun! 🐷" -sleep 1 - exit 0