What are the %U and %u parameters in desktop files?
Desktop files always have either %u or %U as an argument for the program being launched. E.g. here's a line from my firefox.desktop:
Exec=/usr/lib/firefox/firefox %u
What does it mean?
1 answer
They are defined in the Desktop Entry Specification. In fact there are also %f and %F options.
They tell the desktop manager how the program handles multiple files. Like if I select a bunch of files in Dolphin and select "Open with Firefox".
The small %u means that the program expects only a single argument at a time. So invoking with multiselect is actually launching the program several times, once with each file as an argument.
Capital %U means that the program can take them all as a list in a single go.
%f and %F is just the same thing but stands for local Files whereas U is for URL, which works for local files also. This is probably why you don't see much f's.

0 comment threads