LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,332
Blog Entries: 3

Rep: Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727
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 Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
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
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,332

Original Poster
Blog Entries: 3

Rep: Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727
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
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,144

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
~/.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 (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
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
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,332

Original Poster
Blog Entries: 3

Rep: Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727
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



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 08:46 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
Open Source Consulting | Domain Registration