xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
579 stars 272 forks source link

New module: X.L.ConditionalLayout #825

Open slotThe opened 11 months ago

slotThe commented 11 months ago

Supersedes https://github.com/xmonad/xmonad-contrib/pull/582

What I haven't done, yet we probably should (not necessarily in this PR):

TODOS:

New module: X.L.ConditionalLayout

Provide conditional variants of 'ModifiedLayout' and 'Choose', so that modifications (specific layouts) are only applied when a particular condition is met.

Co-authored-by: Tomas Janousek tomi@nomi.cz Co-authored-by: Ivan Malison IvanMalison@gmail.com


Description

Include a description for your changes, including the motivation behind them.

Checklist

slotThe commented 10 months ago

There's a but that I can't figure out right now: Assuming something like

myLayout = onWorkspace "4" (tall ||| Full) $ Full ||| tall ||| Mirror tall
 where
  tall = Tall 1 (3/100) (1/2)

one needs to issue five M-SPC calls to cycle through all layouts, regardless which branch one is on right now (some of those M-SPC invocations will just not do anything—at least not visibly).

Haven't tried debugging this yet, as its getting late, but perhaps someone else immediately knows what's up.

geekosaur commented 10 months ago

Is using Choose internally wise? That's going to add a couple extra mod-space-s and I'm wondering how that interacts with the explicit condition (wouldn't it effectively invert it?).

geekosaur commented 10 months ago

Also it may be better to leave PerScreen alone until we decide what's happening with #813.