Skip to content

Instantly share code, notes, and snippets.

@clexanis
Forked from Thibaut-Fontaine/discord.sh
Last active November 14, 2023 12:09
Show Gist options
  • Save clexanis/3925d6dcc6497e36b384212a40c7bad6 to your computer and use it in GitHub Desktop.
Save clexanis/3925d6dcc6497e36b384212a40c7bad6 to your computer and use it in GitHub Desktop.
discord update script for linux, debian, ubuntu
#!/bin/bash
format="deb"
platform="linux"
while getopts ":f:p:h" opt; do
case $opt in
f) format="$OPTARG" ;;
p) platform="$OPTARG" ;;
h)
echo "Usage: ./script.sh [-f <format>] [-p <platform>] [-h]"
echo "Options:"
echo " -f <format> Specify the download format (default: deb)"
echo " -p <platform> Specify the platform (default: linux)"
echo " -h Display this help message"
exit 0
;;
\?) echo "Invalid option: -$OPTARG" >&2; exit 1 ;;
:) echo "Option -$OPTARG requires an argument." >&2; exit 1 ;;
esac
done
download_url="https://discord.com/api/download/stable?platform=$platform&format=$format"
output_file="discord.deb"
curl -L --output /tmp/$output_file $download_url
sudo apt install /tmp/$output_file
# Update Vencord
## TODO : Test it
curl -L --output /tmp/vencord-installer https://github.com/Vencord/Installer/releases/latest/download/VencordInstallerCli-linux
chmod +x /tmp/vencord-installer
sudo XDG_CONFIG_HOME="$XDG_CONFIG_HOME" /tmp/vencord-installer --reinstall
# Launch Discord detached
nohup discord >/dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment