[xmonad] Add 'browser' to XConfig
David Roundy
droundy at darcs.net
Mon Mar 31 10:58:52 EDT 2008
On Sat, Mar 29, 2008 at 11:45:33PM -0400, gwern0 at gmail.com wrote:
> Why am I constantly supplying Firefox as a parameter? Well, the answer is
> that those functions *need* a browser to use, they can't get away with
> getting it from somewhere else. There is no somewhere else, as there is
> no POSIX standard way of letting a user define a preferred browser (yes,
> I know about Debian's x-www-browser stuff, but that's Debian, and I know
> about environmental variables, but I don't think there's any standard
> $BROWSER like there is $HOME or $EDITOR).
Why not just use BROWSER even though it isn't commonly defined? Just define
a
getBrowser = getEnv "BROWSER" `catch` \_ -> return "firefox"
and it's still just one line (well, plus an import) to define a default
browser in xmonad.hs by calling setEnv in the startupHook (or in main
before calling xmonad). And lo, users are now also able to define their
browser preferences in a non-xmonad-specific location!
I don't like the idea of cluttering up XConfig with this sort of thing.
I'd rather see the terminal pref removed (it seems silly for all the same
reasons) than another pref (that's only used in contrib) added to the core
of xmonad.
If you prefer, we could alternately support XMONAD_BROWSER. Note that
putting the browser in the environment would also make it immediately
runtime-configurable (well, with a few lines of code in contrib).
--
David Roundy
Department of Physics
Oregon State University
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/xmonad/attachments/20080331/b0baee4d/attachment.bin
More information about the xmonad
mailing list