Chromium opens downloaded files using xdg-open
. Problem is, xdg-open
doesn’t work correctly with awesome (and also doesn’t support a number of
other, non-mainstream wms.)
The piece of code responsible for detecting the desktop environment:
(this comes from Gentoo’s xdg-open
, ebuild
x11-misc/xdg-utils-1.1.0_rc1_p20110519
.)
A solution
While we could easily monkey-patch this, or we could just set some environment
variables, but there’s a cleaner solution. Create the script
/usr/local/bin/xdg-open
, so it will take precedence over the real xdg-open
,
and have it set the environment variable only for the process you’re about to
start:
I found some helpful information on this forum dead link
removed, though my idea is different as I want Chromium to use KDE
software when opening files (okular
, gwenview
, etc.)
Update
As of xdg-utils
version 1.1.0_rc1_p20120916, detectDE
is now somewhat
smarter and a lot more complex (~70 LOC).