Score:2

How can I find out where an executable on my favorites bar is located?

kw flag

On Windows the shortcuts can be right clicked and when properties is selected it will show you a window which tells you where the executable target is located.

I have a favorites bar which has a program on it that has at least 3 possible locations (don't ask - it's a mess) and I'd like to know which one the icon is pointing to. I tried the "details" item on the right-click menu and it shows nothing but "no application found".

How can I find out where the link is pointing?

Thanks! Sean

pLumo avatar
in flag
Check out `alacarte` (might need to install it). It will show you all your desktop shortcuts and you can see for each icon "Properties" -> "command".
Sean McGhee avatar
kw flag
@pLumo - thanks for that. I installed it but I found it did not present me with the favorites bar but it was a bit of a long shot. It DOES have a wealth of info which indirectly led me to the actual item I was interested in :-) Much appreciated!
pLumo avatar
in flag
I wrote an answer with some more information, glad that it was helpful
Sean McGhee avatar
kw flag
@pLumo - got it and see below...
Score:1
in flag

The favorite apps are saved as dconf setting, you can read it with:

dconf read "/org/gnome/shell/favorite-apps"

This will print out a list of ".desktop" files, e.g.

['nemo.desktop', 'firefox_firefox.desktop', 'thunderbird.desktop', 'some-program.desktop']

To find the real location of your some-program.desktop, try

locate "some-program.desktop"

or search in the following locations, if locate can not find it or is not installed:

~/.local/share/applications
/usr/share/applications
/var/lib/snapd/desktop/applications

To find the command to your icon, grep for Exec or use cat.

locate "some-program.desktop" | xargs grep ^Exec

GUI only alternative

Run dconf Editor, find /org/gnome/shell/favorite-apps and check out the name of your .desktop file. Then, run alacarte ("Main Menu") (might need to install) and find that icon, right-click -> "Properties" will show you the command.

Sean McGhee avatar
kw flag
thanks again! I have not tried the GUI version but the command line version worked like a charm!
Sean McGhee avatar
kw flag
oh, and since I'm new here, I can't formally upvote your answers so consider it done :-)
vanadium avatar
cn flag
@SeanMcGhee you may not be able to upvote, but as the question asker, you can do something more important: "accept" the question: click the checkmark on the left of the question. This shows other users a helpful answer can be found here.
vanadium avatar
cn flag
`locate` is not anymore by default installed on Ubuntu. You may also mention that there is a priority in the locations: if `.desktop` files with the same name exist in multiple places, the one found in the first searched directory will be used
Sean McGhee avatar
kw flag
@vanadium - accepted!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.