You are not logged in.

#1 2010-08-27 19:05:17

cavoegele
Member
Registered: 2010-08-27
Posts: 1

xdg-open Fix

This is for any frustrated by Google Chrome using random applications to open its downloads.

Google Chrome uses xdg-open to open its downloads. Since I don't use Gnome or KDE, the DE environment variable is unset. If the DE environment variable is unset or set to "generic", xdg-open uses the open_generic_xdg_mime() function to choose the application to open files. This function incorrectly determines the location of the .desktop file. It will come up with something like

/usr/share/applications//usr/share/applications/mplayer.desktop

instead of

/usr/share/applications/mplayer.desktop.

To fix this I added

default=`echo $default | sed "s|[^\w]*/||"`

below the line (line number 384)

default=`xdg-mime query default "$filetype"`.

Setting the default application with xdg-mime default [.desktop file] [mime-type] populates the $HOME/.local/share/applications/defaults.list file. With the fix, xdg-open now correctly uses this file and open applications as expected.

Offline

#2 2010-08-27 19:32:03

cf8
Member
From: Russia
Registered: 2008-10-21
Posts: 83

Re: xdg-open Fix

By the way OP. If you are using pcmanfm: here is handy replacement for /usr/bin/xdg-open  - http://dumpz.org/15027/
It handles http(s), mail and magnet links, and on all other lets pcmanfm deside smile

Offline

Board footer

Powered by FluxBB