From 3663e6a06b6aeaf79b9b65daae77489f1fee9036 Mon Sep 17 00:00:00 2001 From: Blake Ridgway Date: Tue, 9 Apr 2024 09:13:30 -0500 Subject: [PATCH] fixed the discord scripts --- install-discord.sh | 33 +++++++++++++++++++++++++++++++++ update-discord.sh | 23 ++--------------------- 2 files changed, 35 insertions(+), 21 deletions(-) create mode 100755 install-discord.sh mode change 100755 => 100644 update-discord.sh diff --git a/install-discord.sh b/install-discord.sh new file mode 100755 index 0000000..213bb33 --- /dev/null +++ b/install-discord.sh @@ -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 \ No newline at end of file diff --git a/update-discord.sh b/update-discord.sh old mode 100755 new mode 100644 index 213bb33..3cb37d1 --- a/update-discord.sh +++ b/update-discord.sh @@ -5,29 +5,10 @@ if [ "$(id -u)" -ne 0 ]; then exit 1 fi -# Retrive Discord +# Retrieve discord tar.gz file + 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 \ No newline at end of file