LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 10-28-2018, 07:03 AM   #1
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,789
Blog Entries: 3

Rep: Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386
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.
 
Old 10-28-2018, 09:06 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 14,397

Rep: Reputation: 4641Reputation: 4641Reputation: 4641Reputation: 4641Reputation: 4641Reputation: 4641Reputation: 4641Reputation: 4641Reputation: 4641Reputation: 4641Reputation: 4641
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.
 
Old 10-28-2018, 09:16 AM   #3
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,789

Original Poster
Blog Entries: 3

Rep: Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386
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.
 
Old 10-28-2018, 09:00 PM   #4
jmgibson1981
Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 479

Rep: Reputation: Disabled
~/.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.
 
2 members found this post helpful.
Old 10-28-2018, 09:26 PM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,943

Rep: Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141Reputation: 2141
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.
 
Old 10-29-2018, 05:07 AM   #6
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,789

Original Poster
Blog Entries: 3

Rep: Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386Reputation: 2386
Quote:
Originally Posted by jmgibson1981 View Post
~/.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".
 
  


Reply

Tags
ubuntu


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Add A Show Desktop Icon To Ubuntu Dock / Dash To Dock LXer Syndicated Linux News 0 05-29-2018 02:32 PM
How do I change the desktop and dock icon theme? ApplianceGuy Linux Deepin 2 08-09-2013 12:04 PM
KDE4: popup main menu from desktop icon or dock? amoebios Linux - Desktop 2 12-02-2009 09:45 AM
Adding Show Desktop To Cairo Dock Mark7 Linux - Desktop 0 01-20-2008 07:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 10:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration