Skip to content

Instantly share code, notes, and snippets.

@y4my4my4m
Created February 14, 2023 03:31
Show Gist options
  • Select an option

  • Save y4my4my4m/9bf14f603da01cdea6a6ee2fdd27069b to your computer and use it in GitHub Desktop.

Select an option

Save y4my4my4m/9bf14f603da01cdea6a6ee2fdd27069b to your computer and use it in GitHub Desktop.
A quick script to install discord for Arch. Sometimes discord need you to install the udpate as a .tar.gz. This script allows you to auto-install it. Just call this script from where you've downloaded the discord-0.0.25.tar.gz file and call it like "sudo discord-install.sh 25"
#!/bin/sh
set -e
if [ -z "$1" ] || ! [ "$1" -eq "$1" ] 2>/dev/null; then
echo "Invalid or missing argument. Please provide a valid number."
exit 1
fi
if sudo rm -rf /opt/Discord; then
echo "Removed old Discord installation."
else
echo "Failed to remove old Discord installation. Aborting."
exit 1
fi
echo "Extracting new Discord installation (version $1)..."
tar xvfz "$(pwd)/discord-0.0.$1.tar.gz"
echo "Moving new Discord installation to /opt..."
sudo mv "$(pwd)/Discord" /opt
@y4my4my4m

Copy link
Copy Markdown
Author

Just use it like:

  1. Download discord
    discord-0.0.26.tar.gz
  2. Navigate where you downloaded it
    cd ~/Downloads
  3. Launch the script relative to where the .tar.gz file is. Add the version number as argument.
    ../discord-install.sh 26

If ever discord is beyond version -0.0.x simply edit the script.

@matheusfrancisco

Copy link
Copy Markdown

sudo ln -s /opt/Discord/Discord /usr/bin/discord

@y4my4my4m

Copy link
Copy Markdown
Author

@matheusfrancisco hope this script helped somehow!
Any advantage at doing this symlink btw?

@matheusfrancisco

matheusfrancisco commented Aug 23, 2024

Copy link
Copy Markdown

Discord can be launched directly from the search bar without needing to run it in the terminal. Equal to any other program

@y4my4my4m

Copy link
Copy Markdown
Author

@matheusfrancisco good to know, cheers!

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