You are not logged in.

#1 2012-11-15 12:33:23

landzend
Member
Registered: 2012-11-15
Posts: 3

[SOLVED] Chromium not calling xdg-open

Hi,

I have been trying to get Chromium to call external applications based on their name and/or mime type. My desktop is XFCE.

I have read about setting up the xdg-utils, and believe I have it configured. The following command line when run from bash opens up acroread and displays the PDF:

xdg-open http://cran.r-project.org/doc/manuals/R-intro.pdf

My ~/.local/share/applications/defaults.list file is:

application/pdf=acroread.desktop;

But when I click on the link in chromium I get the "Save File" dialog.

As a test, I edited the /usr/bin/xdg-open shell script, and made it write to a file in /tmp when ever it is called. (The second line where I send the date to the /tmp/xdg-open.log file.)

#!/bin/sh
/usr/bin/date >> /tmp/xdg-open.log
#---------------------------------------------
#   xdg-open
#
#   Utility script to open a URL in the registered default application.
#
#   Refer to the usage() function below for usage.
#
#   Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org>

When I try and download a PDF in chromium, it never adds to the /tmp/xdm-open.log file. (But does if I call it from the command line as I did above.)

So to me, it looks like chromium isn't even calling the xdg-open script.

Any one have any ideas?

Thanks in advance.

Last edited by landzend (2012-11-16 10:54:29)

Offline

#2 2012-11-15 15:24:01

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED] Chromium not calling xdg-open

Did you set "Always open files of this type" as explained in the FAQ?
http://support.google.com/chrome/bin/an … swer=95759

Offline

#3 2012-11-15 15:48:17

hiciu
Member
Registered: 2010-08-11
Posts: 84

Re: [SOLVED] Chromium not calling xdg-open

Hello,

For me, chromium is not using xdg-open. You can verify it with:

strace -e process chromium

Then download something and try to open it from chromium. As for solution, try this: install perl-file-mimeinfo package and setup it with 'mimeopen --ask-default some-pdf-file.pdf'.

landzend wrote:

I have read about setting up the xdg-utils, and believe I have it configured. The following command line when run from bash opens up acroread and displays the PDF:

xdg-open http://cran.r-project.org/doc/manuals/R-intro.pdf

This is separate issue, it should run browser (http:// protocol), not acroread. Check this link: http://hiciu.org/some-pdf-file.pdf (harmless). All you know before you open it is the url, not the file type.

Offline

#4 2012-11-16 10:32:25

landzend
Member
Registered: 2012-11-15
Posts: 3

Re: [SOLVED] Chromium not calling xdg-open

teekay wrote:

Did you set "Always open files of this type" as explained in the FAQ?
http://support.google.com/chrome/bin/an … swer=95759

Thanks. This was the answer.

Looks like I had things set up right. Didn't realise I had to download one PDF, then click on it and say to open this type next time...

It also worked for a .torrent file too...

Thanks again.

Offline

#5 2012-11-16 10:53:58

landzend
Member
Registered: 2012-11-15
Posts: 3

Re: [SOLVED] Chromium not calling xdg-open

hiciu wrote:

Hello,

For me, chromium is not using xdg-open. You can verify it with:

strace -e process chromium

Then download something and try to open it from chromium. As for solution, try this: install perl-file-mimeinfo package and setup it with 'mimeopen --ask-default some-pdf-file.pdf'.

landzend wrote:

I have read about setting up the xdg-utils, and believe I have it configured. The following command line when run from bash opens up acroread and displays the PDF:

xdg-open http://cran.r-project.org/doc/manuals/R-intro.pdf

This is separate issue, it should run browser (http:// protocol), not acroread. Check this link: http://hiciu.org/some-pdf-file.pdf (harmless). All you know before you open it is the url, not the file type.

Thanks. I already had the "perl-file-mimeinfo" installed.

Yes. The link you gave above is type "image/jpeg", so the browser has to start the download to even know what it has coming.

Offline

Board footer

Powered by FluxBB