discord-awesomeaudio/install.sh

50 lines
1.3 KiB
Bash
Raw Normal View History

2023-07-11 19:50:07 -04:00
#!/bin/bash
2023-07-11 20:59:42 -04:00
is_package_installed() {
if command -v "$1" >/dev/null 2>&1; then
return 0
else
return 1
fi
}
if [[ -f /etc/os-release ]]; then
. /etc/os-release
if [[ "$ID" == "ubuntu" || "$ID_LIKE" == "ubuntu" ]]; then
if ! is_package_installed flatpak-builder; then
sudo apt update
sudo apt install -y flatpak-builder
fi
elif [[ "$ID" == "fedora" || "$ID_LIKE" == "fedora" ]]; then
if ! is_package_installed flatpak-builder; then
sudo dnf install -y flatpak-builder
fi
elif [[ "$ID" == "void" ]]; then
if ! is_package_installed flatpak-builder; then
sudo xbps-install -Sy flatpak-builder
fi
fi
fi
2023-07-11 19:50:07 -04:00
flatpak-builder build-dir lol.deadzone.discord-awesomeaudio.json --install --user --force-clean
echo '#!/bin/bash
RUNNING=$(pgrep -f "discord-screenaudio")
if [[ -n $RUNNING ]]; then
WM_CLASS="discord-screenaudio"
else
WM_CLASS=""
fi
2023-07-11 20:59:42 -04:00
#flatpak run --env=WM_CLASS="$WM_CLASS" lol.deadzone.discord-awesomeaudio' > ~/.local/bin/discord-awesomeaudio.sh
2023-07-11 19:50:07 -04:00
chmod +x ~/.local/bin/discord-awesomeaudio.sh
echo "[Desktop Entry]
Name=Discord Awesome Audio
Exec=flatpak run lol.deadzone.discord-awesomeaudio
Icon=/path/to/application/icon.png
Type=Application
Categories=AudioVideo;Network;" > ~/.local/share/applications/discord-awesomeaudio.desktop
chmod +x ~/.local/share/applications/discord-awesomeaudio.desktop