You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			82 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			Bash
		
	
			
		
		
	
	
			82 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			Bash
		
	
#!/bin/bash
 | 
						|
 | 
						|
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
 | 
						|
 | 
						|
function error {
 | 
						|
  echo -e "\\e[91m$1\\e[39m"
 | 
						|
  exit 1
 | 
						|
}
 | 
						|
 | 
						|
cd $HOME
 | 
						|
 | 
						|
# Get dependencies
 | 
						|
CODENAME=$(lsb_release -cs)
 | 
						|
# if [[ "${CODENAME}" == "buster" ]]; then 
 | 
						|
#   "${DIRECTORY}/pkg-install" "pulseaudio-utils pulseaudio gnome-themes-extra:armhf gtk2-engines-pixbuf:armhf libxcb-shape0:armhf libxcb-randr0:armhf libxcb-image0:armhf libxcb-xtest0:armhf libxcb-keysyms1:armhf libxcb-xfixes0:armhf libturbojpeg0:armhf libdbus-1-3:armhf libx11-6:armhf libxtst6:armhf libsm6:armhf libicu63:armhf libjsoncpp1:armhf librhash0:armhf libsqlite3-0:armhf libssh-4:armhf libuv1:armhf libwind0-heimdal:armhf libxml2:armhf" "$(dirname "$0")" || exit 1
 | 
						|
if [[ "${CODENAME}" == "focal" ]]; then
 | 
						|
  "${DIRECTORY}/pkg-install" "pulseaudio-utils pulseaudio gnome-themes-extra:armhf gtk2-engines-pixbuf:armhf libxcb-shape0:armhf libxcb-randr0:armhf libxcb-image0:armhf libxcb-xtest0:armhf libxcb-keysyms1:armhf libxcb-xfixes0:armhf libturbojpeg:armhf libdbus-1-3:armhf libx11-6:armhf libxtst6:armhf libsm6:armhf libicu66:armhf libjsoncpp1:armhf librhash0:armhf libsqlite3-0:armhf libssh-4:armhf libuv1:armhf libwind0-heimdal:armhf libxml2:armhf" "$(dirname "$0")" || exit 1
 | 
						|
elif [[ "${CODENAME}" == "groovy" ]]; then
 | 
						|
  "${DIRECTORY}/pkg-install" "pulseaudio-utils pulseaudio gnome-themes-extra:armhf gtk2-engines-pixbuf:armhf libxcb-shape0:armhf libxcb-randr0:armhf libxcb-image0:armhf libxcb-xtest0:armhf libxcb-keysyms1:armhf libxcb-xfixes0:armhf libturbojpeg:armhf libdbus-1-3:armhf libx11-6:armhf libxtst6:armhf libsm6:armhf libicu67:armhf libjsoncpp1:armhf librhash0:armhf libsqlite3-0:armhf libssh-4:armhf libuv1:armhf libwind0-heimdal:armhf libxml2:armhf" "$(dirname "$0")" || exit 1
 | 
						|
elif [[ "${CODENAME}" == "hirsute" ]]; then
 | 
						|
  "${DIRECTORY}/pkg-install" "pulseaudio-utils pulseaudio gnome-themes-extra:armhf gtk2-engines-pixbuf:armhf libxcb-shape0:armhf libxcb-randr0:armhf libxcb-image0:armhf libxcb-xtest0:armhf libxcb-keysyms1:armhf libxcb-xfixes0:armhf libturbojpeg:armhf libdbus-1-3:armhf libx11-6:armhf libxtst6:armhf libsm6:armhf libicu67:armhf libjsoncpp24:armhf librhash0:armhf libsqlite3-0:armhf libssh-4:armhf libuv1:armhf libwind0-heimdal:armhf libxml2:armhf" "$(dirname "$0")" || exit 1
 | 
						|
else 
 | 
						|
	error "this script can't run on your OS! it HAS to be Ubuntu 20.04, 20.10 or 21.04"
 | 
						|
fi
 | 
						|
 | 
						|
#refresh list of libraries
 | 
						|
sudo ldconfig
 | 
						|
 | 
						|
if true;then
 | 
						|
  echo "Downloading Zoom..."
 | 
						|
  rm -rf "${HOME}/zoom" ~/zoom_i686.tar.xz
 | 
						|
  wget 'https://zoom.us/client/5.4.53391.1108/zoom_i686.tar.xz' || wget 'https://d11yldzmag5yn.cloudfront.net/prod/5.4.53391.1108/zoom_i686.tar.xz' || error 'Failed to download Zoom i686!'
 | 
						|
  
 | 
						|
  #get outdated Zoom client from Botspot's mirror because it's more stable
 | 
						|
  #wget 'https://github.com/Botspot/zoom_686_mirror/raw/main/zoom_i686.tar.xz' || error 'Failed to download Zoom i686!'
 | 
						|
  
 | 
						|
  tar -xf ~/zoom_i686.tar.xz || error 'Failed to extract Zoom i686!'
 | 
						|
  rm -f ~/zoom_i686.tar.xz #who cares if this fails
 | 
						|
fi
 | 
						|
 | 
						|
echo 'Creating launcher script'
 | 
						|
echo '#!/bin/bash
 | 
						|
trap "echo '\''Zoom exited. Close this terminal to exit'\'' ; sleep infinity" EXIT
 | 
						|
if [ -z "$(ps aux | grep pulseaudio | grep -v grep)" ];then
 | 
						|
  echo -e "\e[102m\e[30mLaunching pulseaudio.\e[0m"
 | 
						|
  pulseaudio &
 | 
						|
  pulsepid=$!
 | 
						|
  trap "kill $pulsepid" EXIT
 | 
						|
  echo "Pulseaudio PID: $pulsepid"
 | 
						|
  sleep 2
 | 
						|
fi
 | 
						|
cd ${HOME}/zoom/
 | 
						|
echo -e "\e[102m\e[30mLaunching Zoom.\e[0m"
 | 
						|
box86 zoom' > "${HOME}/zoom/runzoom.sh"
 | 
						|
chmod +x "${HOME}/zoom/runzoom.sh"
 | 
						|
 | 
						|
if command -v box86 >/dev/null;then
 | 
						|
  echo "Updating box86..."
 | 
						|
else
 | 
						|
  echo "Installing box86..."
 | 
						|
fi
 | 
						|
"${DIRECTORY}/manage" install-if-not-installed 'Box86' || error "Box86 installation failed!"
 | 
						|
if ! command -v box86 >/dev/null;then
 | 
						|
  error "Box86 failed to install somehow!\n/usr/local/bin/box86 does not exist"
 | 
						|
fi
 | 
						|
 | 
						|
echo "Creating a Zoom button in the Main Menu..."
 | 
						|
echo "[Desktop Entry]
 | 
						|
Name=Zoom
 | 
						|
Exec=${DIRECTORY}/etc/terminal-run "\""$HOME/zoom/runzoom.sh"\"" 'Close this window to exit Zoom'
 | 
						|
Icon=$(dirname "$0")/icon-64.png
 | 
						|
Path=${HOME}/zoom/
 | 
						|
Type=Application
 | 
						|
Comment=i386 version of software platform used for teleconferencing using Box86
 | 
						|
Categories=Network;
 | 
						|
StartupNotify=true" > ~/.local/share/applications/zoom.desktop
 | 
						|
 | 
						|
systemctl --user unmask pulseaudio.service pulseaudio.socket
 | 
						|
systemctl --user enable pulseaudio.service pulseaudio.socket
 | 
						|
 | 
						|
echo "Installation complete!"
 |