Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jalcaldea
Last active April 5, 2020 15:06
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save jalcaldea/acb22b21a8c9f0728198 to your computer and use it in GitHub Desktop.
Save jalcaldea/acb22b21a8c9f0728198 to your computer and use it in GitHub Desktop.
Small script that simplifies Telegram installation in ubuntu.
#!/bin/bash
echo "============================================="
echo "== Telegram Script Installer v 0.1 =="
echo "== =="
echo "== by Jalcaldea =="
echo "============================================="
echo "Downloading necesary files..."
cd /tmp
wget -O - https://tdesktop.com/linux > tsetup.tar.gz
wget -O - https://raw.githubusercontent.com/telegramdesktop/tdesktop/master/Telegram/Telegram/Images.xcassets/Icon.iconset/icon_256x256@2x.png > icon.png
echo "Making destination folder..."
sudo mkdir /usr/share/telegram
sudo chmod +x /usr/share/telegram
echo "Extracting files..."
tar -xvJf tsetup.tar.gz
cd ./Telegram
echo "Copying new files..."
sudo cp ./Updater /usr/share/telegram/Updater
sudo cp ./Telegram /usr/share/telegram/Telegram
user=$(whoami)
sudo chown -R $user:$user /usr/share/telegram/.
echo "Making desktop files..."
cd /tmp
sudo echo "[Desktop Entry]" > telegram.desktop
sudo echo "Name=Telegram" >> telegram.desktop
sudo echo "GenericName=Chat" >> telegram.desktop
sudo echo "Comment=Chat with yours friends" >> telegram.desktop
sudo echo "Exec=/usr/share/telegram/Telegram" >> telegram.desktop
sudo echo "Terminal=false" >> telegram.desktop
sudo echo "Type=Application" >> telegram.desktop
sudo echo "Icon=/usr/share/telegram/icon.png" >> telegram.desktop
sudo echo "Categories=Network;Chat;" >> telegram.desktop
sudo echo "StartupNotify=false" >> telegram.desktop
sudo cp icon.png /usr/share/telegram/icon.png
sudo cp telegram.desktop /usr/share/applications/telegram.desktop
echo "Removing old files..."
rm /tmp/tsetup.tar.gz
rm /tmp/icon.png
rm /tmp/telegram.desktop
rm -R /tmp/Telegram
echo "Installation Complete! Launching Telegram..."
/usr/share/telegram/Updater &
@solarkraft
Copy link

Thank you!

@silvernode
Copy link

You should probably check to see if /usr/share/telegram and create it if i doesn't otherwise continue on.

installdir="/usr/share/telegram"
if [ ! -d ${installdir} ];then
mkdir ${installdir}
else
echo "${installdir} exists...moving on"
fi

@mazingaro
Copy link

Awesome, thank you! :)

@mrroot5
Copy link

mrroot5 commented Oct 29, 2016

Hi! logo image not found. Try this:
wget -O - https://telegram.org/img/t_logo.png > icon.png

Hope it helps :-)

@UlisesLuzius
Copy link

Link to download changed, line 12 should be :
wget -O - https://telegram.org/dl/desktop/linux > tsetup.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment