scripts/bash/usr-local-bin/telegram-desktop

20 lines
746 B
Bash
Executable File

#!/usr/bin/env bash
set -x
# Attempt to start the less annoying fork
if [ -f /var/lib/flatpak/exports/bin/io.github.tdesktop_x64.TDesktop ]; then
flatpak run io.github.tdesktop_x64.TDesktop "$@"
elif [ -f ~/.local/share/flatpak/exports/bin/io.github.tdesktop_x64.TDesktop ]; then
flatpak run --user io.github.tdesktop_x64.TDesktop "$@"
# but if it's not installed, fallback to the official one
elif [ -f /usr/bin/telegram-desktop ]; then
/usr/bin/telegram-desktop "$@"
elif [ -f /var/lib/flatpak/exports/bin/org.telegram.desktop ]; then
flatpak run org.telegram.desktop "$@"
elif [ -f ~/.local/share/flatpak/exports/bin/org.telegram.desktop ]; then
flatpak run --user org.telegram.desktop "$@"
else
print "Telegram not found :)"
fi
set +x