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

20 lines
757 B
Plaintext
Raw Normal View History

2024-06-05 08:34:43 +02:00
#!/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 io.github.tdesktop_x64.TDesktop "$@"
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