Skip navigation

I noticed when I download a file on chromium then try to open it or open its folder by clicking “Open in folder”,  it just opens in firefox anyway. Tracing the problem I found chromium invokes xdg-open, which is an application launcher. It’s actually a generic application launcher that tries to detect your current desktop environment and passes the call to this DE’s application launcher. So if you’re using gnome, xdg-open would eventually direct your request to gnome-open. The problem comes when you’re using a DE not familiar to the script (Fluxbox in my case). The script recognizes only Gnome, KDE, LXDE, Xfce. If your DE is not in those, then xdg-open falls back to a default handler which seems to be the Internet browser.

Luckily in my case I have gnome-open and exo-open installed as they were pulled in when I installed some gnome and xfce apps.  To force xdg-open to use one of them (assume exo-open), you’ll have to trick xdg-open into thinking you have xfce as your DE. To do so, just edit the xdg-open script:

sudo vim /usr/bin/xdg-open

find the line containing the function called “detectDE”. At the very bottom of the function and before the closing braces just add:


Also possible values (gnome,lxde,kde) depending on the launcher you have. Now whenever xdg-open is run (by chromium or whatever) it will treat my DE as if it’s xfce and directs the call to exo-open. To further edit the preferred applications that exo-open runs, just run exo-preferred-applications


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: