2

I want make a desktop icon, that will launch a program. Currently I can launch app from icon in "Show Applications", but I want icon on desktop.
I know, I should use

gnome-desktop-item-edit --create-new ~/Desktop

for creating shortcuts.

The problem is - I don't know command that will launch this particular app from terminal. And obviously, I need this unknown to me command for creating shortcuts. I installed from snap, so I can't just copy icon from /usr/share/applications.

Any advice how to find such command or move icon from "Show Applications" to desktop?

pomsky
  • 68,507
igor Smirnov
  • 123
  • 3
  • 1
    You need to clarify which one you want - open the .desktop file from terminal, how to create a shortcut for snap, or how to place it onto desktop - because these are all separate issues and the post is considered too broad, and might be closed. I can give a hint on the first one : opening .desktop from terminal can be done either via gtk-launch or python script(https://askubuntu.com/a/239883/295286). – Sergiy Kolodyazhnyy Jan 27 '19 at 12:52
  • @sergiy I don't think it's too broad. As I understood OP just wants to create a launcher for a snap application in desktop. They toyed with a couple of ideas: (1) copying the launcher from system, but they failed as it's not there in /usr/share/applications (since it's a snap application), and (2) they tried to create a launcher by hand using gnome-desktop-item-edit, and again they failed as they didn't know what was to be used in the 'command' box. – pomsky Jan 27 '19 at 13:27

1 Answers1

3

As you have mentioned that you installed the application from snap and it can be found in 'Show Applications', the .desktop launcher for the application should be found in the /var/lib/snapd/desktop/applications/ directory. Just copy the .desktop launcher from there to your desktop.

Also you should be able to find the executable for the application in the /snap/bin/ directory. So if you want to manually create the .desktop launcher in your desktop, then you can use /snap/bin/<application> (e.g. /snap/bin/firefox) as the command. You can find the <application> part by running

snap list

Alternatively, you can use snap run <application> as the command (and of course, also to run the application from Terminal).

pomsky
  • 68,507