You are not logged in.

#1 2013-06-11 11:53:21

mkkot
Member
From: Poland
Registered: 2009-12-20
Posts: 288

[solved] xdg-open url.jpg opens it in firefox

Hello,

I'm working on xfce. While clicking in psi IM to a http://....image.jpg link, the image gets opened in a new card of Firefox. Firefox is my default browser. In terminal

xdg-open http://upload.koci.net.pl/uploads/crusader.jpg

does the same. I wish this image to be opened in my image viewer, not in Firefox. In xfce's MIME type configuration I can see image image/jpeg is set to Ristretto.

Last edited by mkkot (2013-06-11 15:29:41)

Offline

#2 2013-06-11 12:24:23

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: [solved] xdg-open url.jpg opens it in firefox

xdg-open uses the browser for all urls (except file://). Everything starting with a scheme and a colon is considered a url.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2013-06-11 12:48:35

mkkot
Member
From: Poland
Registered: 2009-12-20
Posts: 288

Re: [solved] xdg-open url.jpg opens it in firefox

Okay, but I want to open a link to an image in my image viewer. It is possible in KDE.

Offline

#4 2013-06-11 13:50:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,552
Website

Re: [solved] xdg-open url.jpg opens it in firefox

Replace xdg-open.  There are a number of good replacements out there, but all you really need is a script that opens a program of your choosing.  At the simplest, something like:

#!/bin/bash

IMAGE=/path/to/image/viewer
BROWSER=${BROWSER:-/path/to/browser}


fname="$@"
case ${fname##*.} in
	jpg|png|jpeg|bmp) $IMAGE $fname ;;
	html|htm|shtml|sthm) $BROWSER $fname ;;
esac

Last edited by Trilby (2013-06-11 13:50:34)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2013-06-11 14:00:27

mkkot
Member
From: Poland
Registered: 2009-12-20
Posts: 288

Re: [solved] xdg-open url.jpg opens it in firefox

Thanks. Shall I understand your answer as a statement that for now there is no "right way" to do what I want?

Offline

#6 2013-06-11 14:35:10

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: [solved] xdg-open url.jpg opens it in firefox

mkkot wrote:

Thanks. Shall I understand your answer as a statement that for now there is no "right way" to do what I want?

The "right" way is to create a custom script. I suppose with KDE you use Konqueror as a multipurpose application (Konqueror is not only the browser, but also filemanager, ftp client, file viewer)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#7 2013-06-11 14:42:37

mkkot
Member
From: Poland
Registered: 2009-12-20
Posts: 288

Re: [solved] xdg-open url.jpg opens it in firefox

No, actually KDE gave me the way to create bindings as I wanted without Konqueror. It's realized there via kio_ slaves.

look at: https://bugs.kde.org/show_bug.cgi?id=273238

Last edited by mkkot (2013-06-11 14:44:32)

Offline

#8 2013-06-11 15:25:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,552
Website

Re: [solved] xdg-open url.jpg opens it in firefox

Creating your own script could work.  But my best recommendation would be to use one of the ready made replacements for xdg-open.  I've never used it enough to have a real opinion on it, but you're not the first to be unsatisfied with xdg-open - and when archers are unsatisfied, they write solutions.

There is a relatively recently active thread one one archers solution to this problem ... was it mimi or mimi-open, something like that.  I've never had a need for such a tool, but it seems to have been warmly received by other users, so it may do what you want.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2013-06-11 15:29:21

mkkot
Member
From: Poland
Registered: 2009-12-20
Posts: 288

Re: [solved] xdg-open url.jpg opens it in firefox

Okay, thanks! I think the thread can be marked as solved then smile

Offline

Board footer

Powered by FluxBB