Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a `ifWindowCount` function in xmonad?

I am trying to find a function, that allows me to switch between XMonad-Layouts automatically depending on the amount of windows on the screen.

I have experienced similar behavior with the ifWider function, which does the same depending on the screen width.
I doubt that there is a function for that in xmonad-contrib, so should I implement it myself? And how would I do that?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I have never used it but XMonad.Layout.IfMax looks like doing exactly that. You provide a number of windows and two layouts, and it will run one layout if up to that number of windows are present, and the other one otherwise.

import XMonad.Layout.IfMax

myLayoutHook = IfMax 2 Full (Tall ...) ||| ...
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading