[xmonad] Add 'browser' to XConfig

gwern0 at gmail.com gwern0 at gmail.com
Sat Mar 29 23:45:33 EDT 2008


So I was recently contemplating my xmonad.hs (<http://haskell.org/haskellwiki/Xmonad/Config_archive/Gwern's_Config.hs>) and wondering whether my XMonad.Actions.Search and other extensions were yet in their ideal form, and it occurred to me: why do I have to keep writing "firefox"? I even have a shortcut defined, 'ff', which I use at least 8 times.

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).

But of course, I'm not writing "urxvt" all over the place. So why not adopt the same solution? Add another slot, 'browser = "firefox"', and a keybinding. Two straight-forward lines in the core.

I'm aware you can make arguments against this, but I don't think any apply to a browser field more than they apply to a terminal field. Firefox might not be installed; well, neither might XTerm - X.org is not always installed with all the trimmings, my Gentoo system certainly didn't. Users might not want to use it at all; many people don't use terminals either, as they prefer GUIs. Maybe users would prefer Konqueror; sure, but that's why you let it be changed easily - or do most people truly prefer that ugly antique Xterm? Perhaps this problem can be obviated with some sort of generic extension state? Perhaps, but I don't see any clear definition of what this change would be, and I don't see any code or even solid proposals. A bird in the hand...

Would this be useful? I think so. If you search on the Haskell wiki for the string ""firefox"", you see a number of config hits besides mine, many instances that would be helped by browser in the config (eg <http://haskell.org/haskellwiki/Xmonad/Config_archive/Wfarr's_xmonad.hs>; note the 'myBrowser' definition). Would it be used by XMC? I think so. The terminal field is already being used by XMonad/Actions/Commands.hs and XMonad/Util/Run.hs, despite the relative reconditeness of the technique.

--
gwern
edition LLNL embassy aster SDIS Information ISN gun Mena ID
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/xmonad/attachments/20080329/e1563ca1/attachment.bin


More information about the xmonad mailing list