Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script to install Official Telegram Desktop
MACHINE_TYPE=`uname -m`
# Removing old versions
echo 'Removing old versions'
sudo rm -Rf /opt/telegram*
sudo rm -Rf /usr/bin/telegram
sudo rm -Rf /usr/share/applications/telegram.desktop
echo 'Identify Machine Type'
# Identify Machine Type
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
wget "" -O /tmp/telegram.tar.xz
wget "" -O /tmp/telegram.tar.xz
# Extract the files
echo 'Extracting the files'
sudo tar Jxf /tmp/telegram.tar.xz -C /opt/
sudo mv /opt/Telegram*/ /opt/telegram
# Create a shortcut on system
echo 'Creating symbol link'
sudo ln -sf /opt/telegram/Telegram /usr/bin/telegram
# Create a .desktop corrent file
echo 'Create the telegram.desktop file'
echo -e '[Desktop Entry]\nVersion=1.0\nName=Telegram Desktop\nComment=Official desktop version of Telegram messaging app\nExec=/usr/bin/telegram -- %u\nIcon=telegram\nTerminal=false\nStartupWMClass=TelegramDesktop\nType=Application\nCategories=Network;InstantMessaging;Qt;\nMimeType=x-scheme-handler/tg;\n' | sudo tee /usr/share/applications/telegram.desktop
sudo chmod +x /usr/share/applications/telegram.desktop
echo 'Installation finish'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.