Debugging xdg-open

Bastien Nocera hadess at hadess.net
Sat Apr 25 05:27:40 PDT 2015


Hey,

On Sat, 2015-04-25 at 12:09 +0200, Felix Natter wrote:
> hello,
> 
> I am the author of a "freeplane" debian package, and the problem is 
> that
> for a user, it runs successfully from a terminal, but not from a file
> manager (rightclick->run_as I think).
> 
> Now I would like to debug this (possibly using xdg-open):
> 
> - $ file bugreports.mm 
>   bugreports.mm: Freeplane document
> 
> - $ xdg-open bugreports.mm 
> Opening "bugreports.mm" with LibreOffice Writer  (text/x-troff-mm)
> (even though Freeplane is listed first in right-click dialog in
>  nautilus)

It's likely that whatever xdg-open uses to check the mime-type doesn't 
check the magic of the file, and falls back to using the suffix.

> --> Is there another way to debug this? Will "Terminal=true" in a
> desktop file work? Do I need to run a command after I modify
> /usr/share/applications/freeplane.desktop?

sh -x xdg-open bugreports.mm
will show you what actual command it's using to detect the mime-type, 
which is desktop dependent.

Cheers


More information about the xdg mailing list