10

I have downloaded Telegram Messenger for PC/Mac/Linux from their website and copied it to /opt/Telegram/Telegram. After that i have created a sym link in /usr/local/bin that points to the installation directroy and added it to my PATH. Now i can easily start Telgram Messenger from console but how do i get it indexed by Dash including the app icon?

1
12

The programs that show up in the Dash, desktop menus etc are there due to .desktop files in /usr/share/applications & ~/.local/share/applications. You can easily make a launcher using a file similar to this in either of the above locations (named telegram.desktop or similar):

[Desktop Entry]
Encoding=UTF-8
Name=Telegram
Exec=/opt/Telegram/Telegram -- %u
Icon=/opt/Telegram/telegram128.png
Type=Application
Categories=Network;
MimeType=x-scheme-handler/tg;

Note that the Exec line should contain the command to launch the app (like the one you used in Terminal) - this can be like telegram, /usr/bin/telegram-cli, /opt/Telegram/Telegram etc.

The Icon line points to the icon to use - this can be telegram (if there is are appropriately named icons in ~/.local/share/icons or /usr/share/applications), or point to a icon file directly. (e.g. /opt/Telegram/telegram128.png.). If you need a icon I have uploaded one here.

If the file does not show, try running one of these commands:

update-desktop-database /usr/share/applications
update-desktop-database ~/.local/share/applications

depending on where you placed the file. A restart of the desktop (or logging out and back in again) may be necessary. A similar process can be done for other applications.

The spec for a .desktop file can be found here: http://standards.freedesktop.org/desktop-entry-spec/latest/

6
  • 1
    Thx! Telegram already added a .desktop file in ~/.local/share/applications. But the exec part looked like exec=-- $u. I changed it to exec=/opt/Telegram/Telegram %u and it worked. – Andree Wille Jul 19 '15 at 15:23
  • not working for me – Nurlan May 12 '17 at 9:24
  • @Nurlan how so? Telegram will need to be installed, and you need to configure the Exec and Icon lines. – Wilf May 12 '17 at 17:04
  • 1
    @Wilf, The file existed in system. After editing it and restarting the OS I could find icon in dash. Thanks! – Nurlan May 13 '17 at 18:28
  • 1
    @Sigur stick if at the beginning after Exec=env (probably...) or use a bash script EDIT: askubuntu.com/q/144968/178596 – Wilf May 17 '17 at 13:59
4

Also you can install Telegram using snap (Ubuntu 18.04):

$ sudo snap install telegram-desktop

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.