26

Or, more generally, what is the syntax of the commands such as exo-open --launch WebBrowser %u ?

Braiam
  • 67,791
  • 32
  • 179
  • 269

3 Answers3

28

When the program is launched the file manager or program launcher will expand the %u with a single URL or file path of the thing you are trying to open.

See the Freedesktop.org Desktop Entry Specification for other codes that you can use in a .desktop file.

13

From Ubuntu documentation:

Notice the %U used in the .desktop file above. It is used so as the application to be able to accept an argument when dragging and dropping a file inside the Unity bar on the left. Without it, the program will launch itself, but the argument will not be passed to it and it will be just the same as clicking the application so as to launch.

N0rbert
  • 99,918
pLumo
  • 26,947
4

In a .desktop file, what is the “%U” variable?

That is called an Exec key code, which is listed here and discussed with more details in this answer.


Or, more generally, what is the syntax of the commands such as exo-open --launch WebBrowser %u ?

That is a different matter and the use of an Exec key code in this case is both unneeded and has no effect.

It is not part of the expected arguments/parameters for exo-open and will be ignored in this case.

Unless it is used as a parameter / argument for Exec in a .desktop file like so:

Exec=exo-open --launch WebBrowser %u

and in both cases %u is out of the scope of exo-open.

Raffa
  • 32,237