What command does Unity use to launch a program [duplicate]

In /usr/share/applications there will be a .desktop file for the app. This may not have the most obvious name, but you will be able to figure it out by trial and error...

Open the .desktop file and look for the first line that starts with

Exec=

After = is the command the launcher uses to start the program, so you can use it in a terminal.

You may be able to simplify the command, for example, if it is a path, but the application is in your path, you can type only the name of the application. Or, your system might even have a shortcut to it.

Examples

In libreoffice-calc.desktop I find the line

Exec=libreoffice --calc

Typing libreoffice --calc launches libreoffice calc

In python2.7.desktop I find

Exec=/usr/bin/python2.7

But I can launch it with only python because:

$ file $(which python)
/usr/bin/python: symbolic link to python2.7

In the file telegram.desktop I find

Exec=/opt/telegram/Telegram

But I can launch it only with Telegram because I have added /opt/telegram to my path:

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/telegram:/opt/lks-indicator:/snap/bin

(See how to add directories to your path here)


Is there a way I can figure out which command Unity uses to start the client so I can add it to the startup list?

Yes, the command is inside a .desktop file. See /usr/share/applications/ for a lot of them. It probably will be named notes.desktop.

Do a

sudo updatedb
locate notes.desktop

or if that shows nothing use

locate *.desktop | more

and scan for a possible desktop file that looks like notes.

Then do a more notes.desktop and look for the executable (Exec=).


But I would have guessed that the command is actually notes first. The dash will show you the actual command name.