| 
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -7,37 +7,18 @@ function error {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  exit 1
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				arch=''
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				while [ "$arch" != 'armhf' ] && [ "$arch" != 'arm64' ]
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				do
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  echo -n "Which type of Discord do you want? [armhf/arm64] "
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  arch=''
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  read arch
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  if [ "$arch" != 'armhf' ] && [ "$arch" != 'arm64' ];then
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    echo -e "\\e[91mDid not understand '$arch'. Try again.\\e[39m"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  fi
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				done
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				#maker and enter discord-electron folder
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				gio trash ~/discord-electron
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				mkdir ~/discord-electron
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				cd ~/discord-electron || error "Failed to enter discord-electron folder!"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				if [ "$arch" == 'armhf' ];then
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  #Download from github
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  wget https://github.com/SpacingBat3/discord-electron/releases/download/0.2.0/linux-armv7l.tar.gz || error 'Failed to download archive!'
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  tar -xf linux-armv7l.tar.gz || error 'Failed to extract archive!'
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  rm -f linux-armv7l.tar.gz
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				elif [ "$arch" == 'armhf' ];then
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  #Download from github
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  wget https://github.com/SpacingBat3/discord-electron/releases/download/0.2.0/linux-arm64.tar.gz || error 'Failed to download archive!'
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  tar -xf linux-arm64.tar.gz || error 'Failed to extract archive!'
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  rm -f linux-armv7l.tar.gz
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				git clone https://github.com/SpacingBat3/electron-discord-webapp || error "Failed to download repo!"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				if [ ! -f /usr/bin/npm ];then
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  echo "npm is not installed. Installing npm now..."
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  "${DIRECTORY}/pkg-install" "npm" "$(dirname "$0")" || exit 1
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  echo "Updating npm to latest version..."
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				  sudo npm install -g npm || error "failed to update npm to latest version!"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				fi
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				cd $HOME
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				cd electron-discord-webapp
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				npm install
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				#Create desktop shortcut
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				echo "[Desktop Entry]
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -45,7 +26,8 @@ StartupNotify=true
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				Terminal=false
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				Type=Application
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				Name=Discord
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				Exec=${HOME}/discord-electron/discord-electron
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				Path=$HOME/electron-discord-webapp
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				Exec=npm start
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				Icon=/home/pi/pi-apps/apps/Discord/icon-64.png
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				Categories=Network;Chat;VideoConference;WebApp;Internet
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				Comment=Your place to talk!
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
			
			 | 
			 | 
			
				
 
 |