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

Adam Vogt vogt.adam at gmail.com
Sat Dec 19 10:59:47 EST 2009


* 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?

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


More information about the xmonad mailing list