[SOLVED] Adding a custom .desktop icon to the dock panel in Ubuntu 18.04
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Adding a custom .desktop icon to the dock panel in Ubuntu 18.04
How do I add .desktop icon for a custom script or program to the dock panel in Ubuntu 18.04?
On the left of the screen in Ubuntu 18.04 there is a dock panel. For applications run through the applications menu, it is easy to add a shortcut icon there. However, I have not figured out how to add icons there for custom scripts and programs even though I have a proper .desktop file for them. I have tried several approaches including dragging and dropping from the file manager, but the icon won't stick.
You can't do that directly (at least I think). You need to create a .desktop file and put it next to the other desktop files. I cannot check it (the location) at this moment, but probably somewhere /usr/share/.... if I remember well. But I can look into it later.
Next you can search for it in the applications menu and finally right click and add to favorites.
That was also a thought I had. Unfortunately the use case I have for Ubuntu is as a notebook / desktop system for very non-technical people so gymnastics with the file system are out. I'll still hold out for an easier solution even though this is GNOME.
~/.local/share/applications is where to put user specific .desktop files. There is no other option for gnome than to put the .desktop file in the proper place as I understand it.
what #4 said, and that pretty much goes for any wm/dt that using menus with icons. they source the desktop files for the Icon=whatever to know what icon to use.
You could open a desktop file and save it under a different name for a template to your script, and search /usr/share/icons for an icon to use, if you don't already have one.
~/.local/share/applications is where to put user specific .desktop files. There is no other option for gnome than to put the .desktop file in the proper place as I understand it.
That seems to answer the mystery of where to put the .desktop file. I made a hard link to it there and it showed up in the applications menu and from there I could launch it and add it to "favorites".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.