Bug 92312

Summary: xdg-open only open images and links in browser in "generic"
Product: Portland Reporter: Ivan Tham <pickfire>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Ivan Tham 2015-10-06 06:47:43 UTC
Hi, when I run `xdg-open https://bugs.freedesktop.org/`, it will opens it in a browser, and when I run `xdg-open image.jpg`, it will opens it in a browser, I am not using any desktop environments and I have set the setting for xdg-open to open jpg images in `feh`.
Comment 1 Per Olofsson 2015-10-06 08:35:17 UTC
Hi Ivan,

Which version of xdg-utils are you using?
Comment 2 Ivan Tham 2015-10-06 08:38:38 UTC
On Tue, Oct 06, 2015 at 08:35:17AM +0000, bugzilla-daemon@freedesktop.org wrote:
>https://bugs.freedesktop.org/show_bug.cgi?id=92312
>
>--- Comment #1 from Per Olofsson <pelle@debian.org> ---
>Hi Ivan,
>
>Which version of xdg-utils are you using?

1.1.0.git20150323-1
Comment 3 Per Olofsson 2015-10-06 11:26:13 UTC
(In reply to Ivan Tham from comment #2)
> >Which version of xdg-utils are you using?
> 
> 1.1.0.git20150323-1

Could you try running

    sh -x /usr/bin/xdg-open image.jpg

and upload/paste the output here?
Comment 4 Ivan Tham 2015-10-06 12:04:46 UTC
>> >Which version of xdg-utils are you using?
>>
>> 1.1.0.git20150323-1
>
>Could you try running
>
>    sh -x /usr/bin/xdg-open image.jpg
>
>and upload/paste the output here?

Sorry, that works, what I mean is:

    xdg-open http://overthewire.org/img/domokitten.png

Is that out of topic?

Here is the log: http://ix.io/ldV
Comment 5 Per Olofsson 2015-10-06 12:24:43 UTC
(In reply to Ivan Tham from comment #4)
> Sorry, that works, what I mean is:
> 
>     xdg-open http://overthewire.org/img/domokitten.png
> 
> Is that out of topic?
> 
> Here is the log: http://ix.io/ldV

Unfortunately that is difficult to accomplish within xdg-utils itself in a secure manner. Not even GNOME does it.

One solution could be if you install KDE (or at least kde-runtime) and set XDG_CURRENT_SESSION=KDE. Then xdg-open will use kde-open which seems to do what you want. The following command opens the image in eog for me:

  XDG_CURRENT_DESKTOP=KDE xdg-open http://overthewire.org/img/domokitten.png

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.