
On 2008.03.31 07:58:52 -0700, David Roundy
On Sat, Mar 29, 2008 at 11:45:33PM -0400, gwern0@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!
Yes, if anything else uses $BROWSER...
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.
Well, that would be a second best. Consistency is a good thing here if we can't agree to my suggestion. I would prefer both browser and terminal; they are both general interfaces, they are both universally used (heck, browser might be even more common - I could see many people not using terminals though they use browsers), and so on. The only other similarly used genres of programs are editors (covered by $EDITOR) and mail clients (are mail programs handled by env vars?). It's an easy two-line change at its most flagrant, and so on.
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
See my other email about runtime-configurable; I think what would actually be runtime configurable is my suggestion (make it modifiable in xmonad.hs, not the shell configs). -- gwern BVD forces AOL IACIS CCSQ SNT 414 rsta NRC Geraldton