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

- 67,791
- 32
- 179
- 269

- 371
3 Answers
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.

- 87,389
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.
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
.

- 32,237
-
What do you mean "and in both cases
%u
is out of the scope ofexo-open
"? – BeastOfCaerbannog Apr 14 '21 at 19:38 -
1@BeastOfCaerbannog I mean in the second case
Exec=exo-open --launch WebBrowser %u
it is used as a parameter/argument forExec
and notexo-open
. – Raffa Apr 14 '21 at 19:42 -
1Thanks a lot, those are the references I was confusingly looking for. – Éric Viala Apr 15 '21 at 09: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 '21 at 05:44
%U
while in the command it says%u
. These codes are actually case sensitive as described in the docs. The former is a list of URLs while the latter is a single URL. – Dan Apr 14 '21 at 09:48