[xmonad] Issue 548 in xmonad: Feature request: greedyFocusWindow

codesite-noreply at google.com codesite-noreply at google.com
Tue Jun 18 09:29:33 CEST 2013


Status: New
Owner: ----

New issue 548 by yurac... at gmail.com: Feature request: greedyFocusWindow
http://code.google.com/p/xmonad/issues/detail?id=548

It would be nice to have a greedy counterpart of the focusWindow function.
I work with two screens, one of which is my main screen and the other one
used occasionally. I use WindowGo.runOrRaise to focus my browser window and  
I expect the focusing to be greedy. Currently I use the following code  
(with focusWindowGreedy being a copy of focusWindow with view replaced by  
greedyView).
If you find this relevant, I can provide a patch.

Thanks!

focusWindowGreedy :: (Eq s, Eq a, Eq i) => a -> W.StackSet i l a s sd ->  
W.StackSet i l a s sd
focusWindowGreedy w s | Just w == W.peek s = s
                 | otherwise        = fromMaybe s $ do
                     n <- W.findTag w s
                     return $ until ((Just w ==) . W.peek) W.focusUp  
(W.greedyView n s)

raiseGreedy :: Query Bool -> X ()
raiseGreedy = raiseMaybeGreedy $ return ()

runOrRaiseGreedy :: String -> Query Bool -> X ()
runOrRaiseGreedy = raiseMaybeGreedy . safeSpawnProg

raiseMaybeGreedy :: X () -> Query Bool -> X ()
raiseMaybeGreedy f qry = ifWindow qry raiseHookGreedy f

raiseHookGreedy :: ManageHook
raiseHookGreedy = ask >>= doF . focusWindowGreedy

browserQuery = className =? "Google-chrome"

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings



More information about the xmonad mailing list