[xmonad] "minimize" + "boringAuto" in Full-layout: focusUp and focusDown don't change focus

Ralph Hofmann hofmann2004 at arcor.de
Sat Dec 19 14:38:49 EST 2009


Am Samstag, den 19.12.2009, 10:59 -0500 schrieb Adam Vogt:
> * On Saturday, December 19 2009, Ralph Hofmann wrote:
> 
> >Hi
> >
> >I am new to xmonad. I use version 0.9.
> >
> >I am trying to get "minimize" and "boringAuto" working together, like
> >described here:
> >http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-Minimize.html
> ...
> >Everythings works fine, except the Full-mode. In Full-mode the functions
> >focusUp and focusDown from XMonad.Layout.BoringWindows don't switch to
> >the next or previous window. They do nothing. 
> >
> >I would like to be able to cycle in Full-mode through all windows but
> >the minimized windows. Is there anything, I can do?
> >
> >Ralph
> 
> In the case of Full, boringAuto is doing exactly as it is supposed to
> do. I'm not sure that adding a special case to it makes sense to address
> this situation; that would be more surprising behavior; lets say you
> minimize all windows except one, should boringAuto now let you focus
> between windows?

If all windows except one are minimized, "my" boringAuto would behave
exactly like the built in: it would skip the minimized windows and show
only the one not minimized.

It's probably hard to define which behavour is expected and which is
surprising, but I think a generel rule could be: the Full-mode should
follow the same logic of focusing as the tiled mode; unless there is a
strong reason against it. Is there any reason like that?

So in my understanding not "my" boringAuto is the "special case", but
the built in.

> Then again, maybe such a thing should be made an option, since that
> change would be much cleaner and reliable than the following hack based
> on checking your layout description, and then decide to send whichever
> message you want based on that:
> 
> > fu,fd :: X ()
> > fu = checkDescr focusUp (windows W.focusUp) "Minimize Full" -- description might be wrong...
> > fd = checkDescr focusDown (windows W.focusDown) "Minimize Full"
> 
> > checkDescr :: X () -> X () -> String -> X ()
> > checkDescr regular exception exceptionLayout = do
> >   descr <- gets $ description . W.layout . W.workspace . W.current . windowset
> >   if descr == exceptionLayout then exception else regular
> 
> Of course, this is a pretty fragile solution since changing layout
> modifiers can change the layout descriptions, which means you will end
> up with the regular boringAuto behavior.
> 
> Perhaps more reliable would be to compare on the last word of the layout
> description:
> 
> > checkDescr2 :: X () -> X () -> String -> X ()
> > checkDescr2 regular exception exceptionLayout = do
> >   descr <- gets $ description . W.layout . W.workspace . W.current . windowset
> >   let (~=) = (==) `on` (listToMaybe . reverse . words)
> >   if descr ~= exceptionLayout then exception else regular
> 
> And then regardless of which auxiliary function you use (checkDescr2, or
> checkDescr), you can bind the fu and fd actions as you did the regular
> focusUp and focusDown actions.
> 
> If you have trouble for imports, you need at least these ones for checkDescr2:
> 
> > import XMonad
> > import qualified XMonad.StackSet as W
> > import XMonad.Layout.BoringWindows
> > import Data.Function (on)
> > import Data.Maybe (listToMaybe)
> 
> --
> Adam Vogt

Thank you for showing me alternatives. I will have to review some
haskell tutorial before going on;-)

Ralph




More information about the xmonad mailing list