.desktop files

BuraphaLinux Server buraphalinuxserver at gmail.com
Thu May 10 13:30:50 CEST 2007


On 5/10/07, Jannis Pohlmann <jannis at xfce.org> wrote:
> Hey,
>
> Am Thu, 10 May 2007 17:04:58 +0700
> schrieb "BuraphaLinux Server" <buraphalinuxserver at gmail.com>:
>
> > My reading of this page:
> >
> >
> http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html
> >
> > Leads me to believe %f would be replaced by a single file name if you
> > were using the file manager and did an "open with other application"
> > and chose the icon for app.
>
> Please always reply at the bottom of the mail.
>
> Your understanding of %f is correct. But in your initial mail you wrote
> about starting your application from a menu. Are you referring to the
> desktop menu / the menu plugin for the panel? Because if so, the %f
> would be just ignored because the menu doesn't know about any files
> (unless there is some kind of drag-a-file-to-a-menu-item feature
> implemented).
>
> If you're referring to Thunar (the scenario you described in *this*
> mail) then yes, "Exec=app ... %f" should do what you need. Quoting
> isn't needed at all in the Exec= line by the way. It works perfectly
> here, even with your example.
>
>   - Jannis
>
Hello,

It took me a while to figure out how to do the strange bottom-posting
style you want in gmail, but I got it.  Anyway, on with the message...

File manager launches twice, once with the '-draw' argument and
again with the filename.  This is not what I expected.

The menu I get from the blue X with the mouse on it on the
panel of icons at the bottom of the screen (has the logout, browser, etc on that
bar too) shows the correct icon and runs the script, but it runs only
once and drops all arguments.

Yes, I know '%f' is blank in that case.  But it should still send the other
arguments that were in the .desktop file (-draw in this example) and it does
not.  I suspect I have bad quoting syntax, but I am not sure.

I can create distinct scripts for each application, but this does appear
to be a bug in the handling of Exec lines in .desktop files that
breaks the specification.  If you can have no arguments execept exactly
one %-type specifier I'm ok with that, but that is not what the spec
says should happen, and it means that I have to create a separate script
for every possible argument combination instead of one script and
multiple .desktop files.

The exact line in the draw.desktop is:

Exec=openoffice -draw %f

I expect this to launch the executable 'openoffice' with the argument
'-draw' and if %f is not blank, the filename from that appended as well
to be the 2nd argument in the list so argv[0] is 'openoffice',
argv[1] is '-draw', and if %f was not blank, argv[2] is the filename
that %f represents.  It should do this the same for both the file manager
and the menu in the panel, with the %f always empty in the panel menu
case.

The file manager instead does this:

1.  execcute 'openoffice' with argument '-draw'
2.  if %f is not blank, execute 'openoffice' a second time but
    with only the filename from %f  and not '-draw'.

The panel thing does this:

1.  execute 'openoffice' with no arguments.

BLS



More information about the Xfce mailing list