Skip to content

Instantly share code, notes, and snippets.

@LinusCDE
Last active July 8, 2020 20:34
Show Gist options
  • Save LinusCDE/0f0fd03c8f8902fcefe4c4d82836ae24 to your computer and use it in GitHub Desktop.
Save LinusCDE/0f0fd03c8f8902fcefe4c4d82836ae24 to your computer and use it in GitHub Desktop.
Install Glasscord on Linux
#!/bin/sh
if [ $UID -ne 0 ]; then
echo "Root required!" >&2
exit 1
fi
if [ ! -d /opt/discord/resources ]; then
echo "Discord is not installed, where it is expected" >&2
echo "Make sure to have discord installed in /opt/discord using" >&2
echo "your NATIVE package manager!" &>2
exit 1
fi
cd /opt/discord/resources
if [ -d app ]; then
echo "Glasscord may already be installed!" >&2
echo "If you still want to install it, just run " >&2
echo "sudo rm -r /opt/discord/resources/app/" >&2
echo >&2
echo "After that you can run this installation again." >&2
exit 1
fi
asar ef app.asar package.json
mkdir app/
mv package.json app/
cd app/
wget https://github.com/AryToNeX/Glasscord/releases/download/v0.2/glasscord.asar -O glasscord.asar
cp package.json package.json.orig # Backup
rm -f package.json.new # Clear new file
echo -e "\n" >> package.json # Ensure new line in input file
while IFS= read -r line
do
#echo $line
if echo $line | grep '"main":' >/dev/null 2>&1; then
# Replace "main": "bla" with "main": "./glasscord.asar"
echo '"main": "./glasscord.asar",' >> package.json.new
else
echo $line >> package.json.new
fi
done < "package.json"
mv package.json.new package.json
echo "Done"
cat <<EOF
Getting everything to work:
$ betterdiscordctl install
If that fails, just clean discord by deleting ~/.config/discord
Get this example css script:
https://github.com/AryToNeX/Glasscord/blob/master/extras/discord_example_theme/discord_example.theme.css
Save it in custom css in discord BD settings.
Maybe change --glasscord-titlebar there from osx to windows or linux (normal window)
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment