Re: Debugging xdg-open

2015-04-27 Thread Felix Natter
Bastien Nocera had...@hadess.net writes:

 Hey,

hello Bastien,

thanks for the quick reply. The problem in this case was that
JAVA_HOME was set in a place so that it does not work with
  bash -c /usr/bin/freeplane
but it works with 
  bash -i -c /usr/bin/freeplane

(although the user has placed the export in both ~/.bashrc and
~/.profile...)

-- but this problem probably belongs to a general UNIX mailing list.

 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.

I guess you are right, it uses the ending and somehow decides
that it's troff-mm (whatever that is).

$ file bugreports.mm
bugreports.mm: Freeplane document

$ xdg-open bugreports.mm 
Opening bugreports.mm with LibreOffice Writer  (text/x-troff-mm)

/usr/share/mime/packages/freeplane.xml:
  http://paste.debian.net/169322/
-- this uses the magic present in the file:
map version=freeplane 1.2.0

Is there a way to make xdg-open behave like nautilus run_as
(this actually chooses freeplane based on magic above)?

 -- 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.

$ sh -x xdg-open bugreports.mm 
sh: 0: Can't open xdg-open

Thanks and Best Regards,
-- 
Felix Natter
___
xdg mailing list
xdg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xdg


Re: Debugging xdg-open

2015-04-25 Thread Bastien Nocera
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
___
xdg mailing list
xdg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xdg