options %u and others %

Asked by klown

Hello,

I would like to know where i can find opions like the %u found in the default launcher on my desktop.
I want to find a list of them and what they do, to maybe reusing it.
I've looked at man and --help, trough the gnome help too, t nothing. Gnome help indicate a list of these kind of options but the %u doesn't seems to be the same utility in amarok. And for exemple i've been founded %s in an other application and this one doesn't exist in gnome help.
Can you help me to find the list to be used with amarok please?

Question information

Language:
English Edit question
Status:
Solved
For:
Amarok Edit question
Assignee:
No assignee Edit question
Solved by:
Harald Sitter
Solved:
Last query:
Last reply:
Revision history for this message
Harald Sitter (apachelogger) said :
#1

I assume you're talking about the exec key which is described in the Desktop Menu Spec.
http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html#exec-variables

Revision history for this message
klown (klown) said :
#2

Yes that's it, but in your link where is the %s option? and that the %u is for in amarok. I'm sorry to don't understand perfectly but softwares seems to have % options not listed with the ones for gnome. And not listed in man or help.
Thanks for first answer and sorry to disturb.

Revision history for this message
Best Harald Sitter (apachelogger) said :
#3

The understanding of this is a bit complicate, the %% keys only get interpreted by the desktop (Gnome, KDE...) it defines certain arguments which can be processed by the application.

Use case for %u:
You click a music file in your desktop's file manager. The file manager know that Amarok can play the music file because it hopefully is listed as the supported files in the amarok.desktop file. Now the file manger just starts Amarok and passes the file URL because of the %u right away.
If you do the same thing with more than one file, the %u prevents the file manager from executing Amarok with a whole list of files but instead it passes file by file as argument.

So the exec keys basically just tell the desktop what kind of argument the application can process. If Amarok couldn't stream directly from HTTP we would use %f because this would make the file manager download the HTTP file (i.e. store it locally somewhere) and then pass the local file to Amarok (/tmp/cache/file.mp3 vs. http://localhost.com/file.mp3).

...I really don't know what the %s option is supposed to do, it might be something GNOME specific.

Revision history for this message
klown (klown) said :
#4

Ok, thanks for the help Harald, very quick, impressive. I will go now to the gnome forum to try to get some help about %%. Have a nice day.