17

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

2
21

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.

12

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.

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.

4
  • What do you mean "and in both cases %u is out of the scope of exo-open"? – BeastOfCaerbannog Apr 14 at 19:38
  • 1
    @BeastOfCaerbannog I mean in the second case Exec=exo-open --launch WebBrowser %u it is used as a parameter/argument for Exec and not exo-open. – Raffa Apr 14 at 19:42
  • 1
    Thanks a lot, those are the references I was confusingly looking for. – Éric Viala Apr 15 at 9:14
  • I have used a couple of these in the past, but didn't know what they were called so I could look them up. Thanks. – Joe Apr 16 at 5:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.