I had noticed the Discord update weirdness on my new OMLx install, but because I’ve had a rough start and had to make some modifications, I thought it was maybe my fault. Then I saw Brodie’s video about it.
In short, whenever Discord starts, it checks for updates, and if there is an update, Discord tells you to go and download and install the update before you can access Discord again.
Either you have to manually update before each use (because Discord releases patches every 4 minutes and the repos don’t keep up), use the web version (I’d prefer to keep Discord separate from my browser in case of browser crashes), or disable the update check altogether.
So I have written a script that automatically checks the latest version of Discord, updates if necessary, and then boots Discord for you.
If that sounds useful to you, the code and instructions can be found in a Gist that I apparently can’t link to? Very helpful…
OK, I’ll post the code and instructions here as well, although my first priority will be keeping the Gist up to date.
discord.sh
#!/bin/bash
# Written by Luke Boland / TehMagilla 2025
# Released under Creative Commons
# Make sure the download folder exists
mkdir dlpackages1 2> /dev/null
echo "Checking for most recent package..."
CURFILE=$(curl -sIkL "https://discord.com/api/download?platform=linux&format=tar.gz" | grep "location:" | awk -F '/' '{print $7}')
# Clean out the weirdness (some unprintable control characters were coming out of curl/grep/awk)
CURFILE=$(echo $CURFILE | sed 's/[^a-zA-Z0-9\.\-]//g')
CURFILE=dlpackages/$CURFILE
if [ ! -f $CURFILE ];
then
echo "New version of Discord to install, updating..."
wget -P ./dlpackages/ "https://discord.com/api/download?platform=linux&format=tar.gz"
echo "Download complete"
for file in $(ls -t -w 1 | grep ".tar.gz" | sed -n 1p)
do
tar -xvzf $file -C ../../
done
echo "Archive decompressed"
fi
echo "Starting Discord"
./Discord > /dev/null 2>&1 &
How to use this:
-
Create a folder for Discord to live in. I chose ~/apps/Discord/
-
Put the attached file (discord.sh) in the Discord folder you just created (ie ~apps/Discord/discord.sh)
-
Make discord.sh executable (ie chmod +x ~apps/Discord/discord.sh)
-
Run discord.sh (ie ~apps/Discord/discord.sh)
What it does:
-
Make sure there's a separate folder to download into
-
Check with the discord server to see if you have the current version
-
If you don't, download the latest available file, unzip it to your Discord folder
-
Copy the discord.desktop file to your local desktop launcher folder (~/.local/share/applications)
-
Start Discord
Discord also make a .deb version available. It shouldn’t take too many edits to make that work as well, but I don’t have a .deb-based system to test it on.