#!/bin/bash
version=4.10.2

killall webcord &>/dev/null && echo "Closing Discord first..."

install_packages "https://github.com/SpacingBat3/WebCord/releases/download/v${version}/webcord_${version}_armhf.deb" || error "Failed to download webcord.deb"

#change this to true to brand Webcord as Discord
if false;then
  sudo sed -i 's/Name=.*/Name=Discord/g' /usr/share/applications/webcord.desktop

  sudo wget -qO /usr/share/pixmaps/webcord.png 'https://logodownload.org/wp-content/uploads/2017/11/discord-logo-7-1.png' || sudo cp -f "$(dirname "$0")/icon-64.png" /usr/share/pixmaps/webcord.png
  
  sudo cp -f /usr/share/pixmaps/webcord.png /usr/lib/webcord/resources/app.asar.unpacked/sources/assets/icons/app.png
  sudo cp -f /usr/share/pixmaps/webcord.png /usr/lib/webcord/resources/app.png
fi

