[xmonad] xmonad-contrib patch
lanny at cisco.com
Tue Jun 3 10:42:42 EDT 2008
I wasn't thrilled with it either but wasn't sure where to put
actionMaybe (the name I had for it). In WindowGo and import into
CopyWindow? In a new Util module and import into both?
There's also the problem that
focus :: win -> X ()
(windows . copyWindow) :: win -> ws -> X()
where 'ws' has to be discovered in actionMaybe. So
raiseMaybe = actionMaybe (focus . const)
copyMaybe = actionMaybe (windows . copyWindow)
actionMaybe = (Window -> Workspace -> X ()) -> Query Bool -> X ()
actionMaybe doWin f thatUserQuery = withWindowSet $ \x -> do
maybeResult <- filterM (runQuery thatUserQuery) (allWindows s)
case maybeResult of
 -> f
(win:_) -> doWin win (currentTag s)
which I don't know if I'm happy about.
Anyway happy to make the changes if I can get some advice on where
to put the abstracted (hoisted?, common?) code.
Gwern Branwen wrote:
> On 2008.06.02 16:26:57 -0500, Lanny Ripple <lanny at cisco.com> scribbled 21K characters:
>> Hi all,
>> Just wanted to say Thanks! to everyone for XMonad. I've got it
>> running with gnome for the panels but it blows the gnome WM out of
>> the water.
>> I did run across some functionality I wanted that didn't exist so I
>> wrote it up (attached). On reflection I should have added a long
>> patch message. I found WindowGo for runOrRaise but often I want to
>> pull a window (browser, mail, etc) to my current workspace instead
>> of going to the one it's in. copyOrRun (and underlying copyMaybe)
>> do that.
> This looks interesting, but I am not thrilled by the duplication of raiseMaybe's code (DRY). Could raiseMaybe and copyMaybe be specialized functions instead, perhaps?
> It would look something like this, I guess:
> somethingMaybe âˆ· (Window -> X ()) -> X () â†’ Query Bool â†’ X ()
> somethingMaybe doWin f thatUserQuery = withWindowSet $ Î»s â†’ do
> maybeResult â† filterM (runQuery thatUserQuery) (W.allWindows s)
> case maybeResult of
>  â†’ f
> (x:_) â†’ doWin x
> raiseMaybe = somethingMaybe focus
> copyMaybe = somethingMaybe (windows . flip copyWindow (currentTag s))
> SBU botux Crust SALDV hrt .45 Threat Nike comsat 747
More information about the xmonad