Skip to content

Instantly share code, notes, and snippets.

@belkarx
Created July 26, 2021 22:51
Show Gist options
  • Save belkarx/46dabb95a875f8daa02575f4efeaa35a to your computer and use it in GitHub Desktop.
Save belkarx/46dabb95a875f8daa02575f4efeaa35a to your computer and use it in GitHub Desktop.
Install Discord on Linux
#!/bin/bash
#this should technically work in zsh and other popular shells
#run with sudo, in the folder you want the source to be extracted in (example: cd ~/Downloads && ./../discordinstall.sh)
#make sure to chmod +x before attempting to run
DATE=$(date +"%m-%d-%Y")
wget "discord.com/api/download?platform=linux&format=tar.gz" --output-document="discord-$DATE.tar.gz"
sudo tar -xvzf "discord-$DATE.tar.gz" -C /opt
sudo ln -sf /opt/Discord/Discord /usr/bin/Discord
echo "[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 deskto>
GenericName=Internet Messenger
Exec=/usr/bin/Discord
Icon=/opt/Discord/discord.png
Type=Application
Categories=Network;InstantMessaging;
Path=/usr/bin
" > /usr/share/applications/discord.desktop
echo -e "\e[1m\e[36mDiscord is installed\e[0m"
#remove discord
#rm -r ~/.config/discord
#sudo rm -rf /usr/bin/Discord
#sudo rm /usr/bin/Discord
#sudo rm /usr/share/applications/discord.desktop
@belkarx
Copy link
Author

belkarx commented Jul 26, 2021

Occasionally discord decides to update and generally that means re-installing it (if you are on Linux) so I wrote a script to automate that process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment