Last active
January 17, 2022 04:03
-
-
Save ilobmirt/9016fde2c0fe578df31bd5b32f72dae7 to your computer and use it in GitHub Desktop.
Downloads, exctracts, and sets up amd64 version of zoom for linux. Typically for box64 on arm64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#=================================================================================================# | |
#install_zoom.sh | |
#---------- | |
#by: ilobmirt @ 2022_JAN_16 | |
# | |
#Downloads, exctracts, and sets up amd64 version of zoom for linux. Typically for box64 on arm64 | |
#Learn more about box64 at the project's github page - https://github.com/ptitSeb/box64 | |
#Zoom is mainly found and available through their main website - https://zoom.us/ | |
#=================================================================================================# | |
online_source="https://zoom.us/client/latest/zoom_x86_64.tar.xz" | |
tmp_location="$HOME/Downloads/tmp_zoom64" | |
install_location="$HOME/x64_apps" | |
desktop_file="$HOME/.local/share/applications/zoom_x64.desktop" | |
install_architecture="amd64" | |
verify_architecture(){ | |
if [ -z $(dpkg --print-foreign-architectures | grep $install_architecture) ]; then | |
echo "Adding $install_architecture to system's package lists" | |
dpkg --add-architecture $install_architecture | |
sudo apt-get update | |
fi | |
} | |
verify_environment(){ | |
local search_target="<<x64_LIB_SEARCH_TARGET>>" | |
local library_path="$HOME/x64_lib" | |
local env_file="$HOME/.bashrc" | |
local env_addendum=" | |
#$search_target | |
#Setup Box64 emulated libraries to include local directory | |
# include x64_lib if it exists | |
if [ -d \"$library_path\" ]; then | |
if [ -n \"\$BOX64_LD_LIBRARY_PATH\" ]; then | |
BOX64_LD_LIBRARY_PATH=\"$library_path:\$BOX64_LD_LIBRARY_PATH\" | |
else | |
BOX64_LD_LIBRARY_PATH=\"$library_path:./:lib/:lib64/:x86_64/:bin64/:libs64/\" | |
fi | |
fi | |
" | |
if [ -z $(grep -F "$search_target" $env_file) ]; then | |
#We haven't set up the x64 environment yet | |
echo "Updating $env_file to reference x64 libraries" | |
echo "$env_addendum" >> $env_file | |
fi | |
} | |
verify_lib_path(){ | |
local library_path="$HOME/x64_lib" | |
if [ ! -d "$library_path" ]; then | |
#We haven't set up any custom x64 libraries yet | |
echo "setting up x64 libraries directory" | |
mkdir $library_path | |
fi | |
} | |
make_desktop(){ | |
local file_contents="[Desktop Entry] | |
Encoding=UTF-8 | |
Version=1.0 | |
Type=Application | |
Terminal=false | |
Exec=$install_location/zoom/ZoomLauncher | |
Name=ZOOM x64" | |
echo "Making a desktop file at $desktop_file" | |
echo "$file_contents" > $desktop_file | |
} | |
if [ ! -d "$install_location" ]; then | |
#We haven't setup any x64 apps yet | |
echo "Creating x64 application directory" | |
mkdir $install_location | |
elif [ -d "$install_location/zoom" ]; then | |
#We are installing a clean instance of zoom for the x64 platform | |
echo "Removing old copy of zoom" | |
rm -rf $install_location/zoom | |
fi | |
if [ -f $desktop_file ]; then | |
echo "Removing old desktop file" | |
rm $desktop_file | |
fi | |
#Verify if x64 libraries are set up | |
echo "Verifying x64 architecture is set up for this computer" | |
verify_architecture | |
verify_lib_path | |
verify_environment | |
echo "Downloading the latest client" | |
mkdir $tmp_location | |
wget $online_source -P $tmp_location | |
echo "Extracting zoom to x64 application directory" | |
tar -xf $tmp_location/*.xz --directory $install_location | |
echo "Cleanig up after install" | |
rm -rf $tmp_location | |
echo "Downloading dependencies" | |
sudo apt-get install libxcb-xtest0:arm64 1> /dev/null | |
if [ ! -f $desktop_file ]; then | |
make_desktop | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment