fixed the discord scripts
This commit is contained in:
		
							parent
							
								
									6d8ca32b5c
								
							
						
					
					
						commit
						3663e6a06b
					
				
					 2 changed files with 35 additions and 21 deletions
				
			
		
							
								
								
									
										33
									
								
								install-discord.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										33
									
								
								install-discord.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -0,0 +1,33 @@
 | 
				
			||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "$(id -u)" -ne 0 ]; then
 | 
				
			||||||
 | 
					        echo 'This script must be run by root' >&2
 | 
				
			||||||
 | 
					        exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Retrive Discord
 | 
				
			||||||
 | 
					wget "https://discord.com/api/download?platform=linux&format=tar.gz" -O discord.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Extract files to /opt directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					tar -xvf discord.tar.gz -C /opt/;rm discord.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Create symbolic link
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ln -sf /opt/Discord/Discord /usr/bin/Discord
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# adding desktop file
 | 
				
			||||||
 | 
					cat > ./temp << "EOF"
 | 
				
			||||||
 | 
						[Desktop Entry]
 | 
				
			||||||
 | 
						Name=Discord
 | 
				
			||||||
 | 
						StartupWMClass=discord
 | 
				
			||||||
 | 
						Comment=All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone.
 | 
				
			||||||
 | 
						GenericName=Internet Messenger
 | 
				
			||||||
 | 
						Exec=/usr/bin/Discord
 | 
				
			||||||
 | 
						Icon=/opt/Discord/discord.png
 | 
				
			||||||
 | 
						Type=Application
 | 
				
			||||||
 | 
						Categories=Network;InstantMessaging;
 | 
				
			||||||
 | 
						Path=/usr/bin
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cp ./temp /usr/share/applications/discord.desktop;rm ./temp
 | 
				
			||||||
							
								
								
									
										23
									
								
								update-discord.sh
									
										
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										23
									
								
								update-discord.sh
									
										
									
									
									
										
										
										Executable file → Normal file
									
								
							| 
						 | 
					@ -5,29 +5,10 @@ if [ "$(id -u)" -ne 0 ]; then
 | 
				
			||||||
        exit 1
 | 
					        exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Retrive Discord
 | 
					# Retrieve discord tar.gz file 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wget "https://discord.com/api/download?platform=linux&format=tar.gz" -O discord.tar.gz
 | 
					wget "https://discord.com/api/download?platform=linux&format=tar.gz" -O discord.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Extract files to /opt directory
 | 
					# Extract files to /opt directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
tar -xvf discord.tar.gz -C /opt/;rm discord.tar.gz
 | 
					tar -xvf discord.tar.gz -C /opt/;rm discord.tar.gz
 | 
				
			||||||
 | 
					 | 
				
			||||||
# Create symbolic link
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ln -sf /opt/Discord/Discord /usr/bin/Discord
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# adding desktop file
 | 
					 | 
				
			||||||
cat > ./temp << "EOF"
 | 
					 | 
				
			||||||
	[Desktop Entry]
 | 
					 | 
				
			||||||
	Name=Discord
 | 
					 | 
				
			||||||
	StartupWMClass=discord
 | 
					 | 
				
			||||||
	Comment=All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone.
 | 
					 | 
				
			||||||
	GenericName=Internet Messenger
 | 
					 | 
				
			||||||
	Exec=/usr/bin/Discord
 | 
					 | 
				
			||||||
	Icon=/opt/Discord/discord.png
 | 
					 | 
				
			||||||
	Type=Application
 | 
					 | 
				
			||||||
	Categories=Network;InstantMessaging;
 | 
					 | 
				
			||||||
	Path=/usr/bin
 | 
					 | 
				
			||||||
EOF
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
cp ./temp /usr/share/applications/discord.desktop;rm ./temp
 | 
					 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue