LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Adding a custom .desktop icon to the dock panel in Ubuntu 18.04 (https://www.linuxquestions.org/questions/linux-desktop-74/adding-a-custom-desktop-icon-to-the-dock-panel-in-ubuntu-18-04-a-4175641299/)

Turbocapitalist 10-28-2018 07:03 AM

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.

pan64 10-28-2018 09:06 AM

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.

Turbocapitalist 10-28-2018 09:16 AM

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.

jmgibson1981 10-28-2018 09:00 PM

~/.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.

BW-userx 10-28-2018 09:26 PM

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.

Turbocapitalist 10-29-2018 05:07 AM

Quote:

Originally Posted by jmgibson1981 (Post 5920312)
~/.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".


All times are GMT -5. The time now is 05:33 PM.