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?
- 30,732
- 289
2 Answers
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/
Also you can install Telegram using snap (Ubuntu 18.04):
$ sudo snap install telegram-desktop
- 181