[xmonad] Re: darcs patch: Shell.hs: +getBrowser, getEditor, helper... (and 5 more)

Justin Bogner mail at justinbogner.com
Tue Apr 1 15:25:52 EDT 2008

gwern0 at gmail.com wrote:
> On 2008.04.01 07:13:17 -0600, Justin Bogner <mail at justinbogner.com> scribbled 1.8K characters:
>> gwern0-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org wrote:
>>> Mon Mar 31 21:34:47 EDT 2008
>>> gwern0-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
>>>   * Shell.hs: +getBrowser, getEditor, helper function
>>>   The helper function asks the shell for the value of a variable, else
>>> returns the second argument.
>>>   getBrowser and getEditor obviously specialize it for two particular
>>> possibly queries
>>> Mon Mar 31 21:39:47 EDT 2008
>>> gwern0-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
>>>   * Search.hs: remove an argument from selectSearch and promptSearch
>>>   The new getBrowser function allows us to mv the old selectSearch and
>>> promptSearch aside as too-general functions, and replace them with new
>>> versions, which employ getBrowser to supply one more argument. This allows
>>> us to replace the tedious 'selectSearch google "firefox"; selectSearch
>>> yahoo "firefox"...' with shorter 'selectSearch google' and so on. One less
>>> argument.
>>>     Also, update the docs.
>>> Mon Mar 31 21:50:49 EDT 2008
>>> gwern0-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
>>>   * RunOrRaise.hs: FF 3 doesn't use the "Firefox-bin" classname
>>> Mon Mar 31 22:17:40 EDT 2008
>>> gwern0-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
>>>   * WindowGo.hs: +raiseBrowser, raiseEditor
>>>   Specialize runOrRaise in the same way as with Actions.Search, for one's
>>> browser and one's editors.
>>> Mon Mar 31 22:20:12 EDT 2008
>>> gwern0-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
>>>   * forgot a haddock for getEditor in Shell.hs
>>> Mon Mar 31 22:31:30 EDT 2008
>>> gwern0-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
>>>   * improve WindowGo.hs Haddock formatting
>> As for the changes to RunOrRaise, firefox 3 actually works without
>> resorting to classname (the pid thing works). I was just wary about
>> changing it since firefox 3's not out yet, and that doesn't work with older
>> firefoxes
>> _____
>> Justin Bogner
> I dunno what the pid thing is; classes are kind of fragile, so I'm interested in a better way (though I believe that by title and class is how all the other wms implement run-or-raise).
> But are you sure my change doesn't work with older Firefoxes? From reading the docs, I had understand that 'className =? "Firefox-bin"     <||> className =? "Firefox"' should work, as it will match any windows that use either the new Firefox 3 classname of 'Firefox', or an older firefox using 'Firefox-bin' as a class.
> (Admittedly, I did not test the or'ing with both a new and old Firefox, but I used to use the first matcher and it worked fine, and I use the new matcher now, and it works fine; so the disjunction should follow AFAIK.)
> --
> gwern
> explosion dog SASP PPP Sears passwd fulminate Choe WINGS Golani
Your solution works for both, sorry to confuse. The RunOrRaise prompt
actually has a trick in it which tries to find a process based on its
pid (it gets the pid of the window and running pidof `the app you're
trying to run`), and this works for firefox 3, so that version of the
function isn't actually needed at all...
Any case, it doesn't matter. your patch works fine.
Justin Bogner

More information about the xmonad mailing list