xmonad-contrib icon indicating copy to clipboard operation
xmonad-contrib copied to clipboard

New module: X.L.ConditionalLayout

Open slotThe opened this issue 2 years ago • 4 comments

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

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

  • ~~Rewrite IfMax, PreScreen, and PerWorkspace with this, which would close https://github.com/xmonad/xmonad-contrib/issues/75~~
  • ~~Provide some QOL functions so that it's easier to write predicates. E.g., I reckon lots of people will want to use a variant of gets $ find ((t ==) . W.tag) . W.workspaces . windowset.~~
  • I'm not sure if this is enough docs still

TODOS:

  • [ ] Find out what's up with https://github.com/xmonad/xmonad-contrib/pull/825#issuecomment-1699675337
  • [ ] Docs and changelog entries for all the deprecations
  • [ ] Docs for the exported helper functions

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 [email protected] Co-authored-by: Ivan Malison [email protected]


Description

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

Checklist

  • [x] I've read CONTRIBUTING.md

  • [x] I've considered how to best test these changes (property, unit, manually, ...) and concluded: cursory testing on my computer yielded the desired results, though someone else should look at this.

  • [x] I updated the CHANGES.md file

slotThe avatar Aug 23 '23 10:08 slotThe

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.

slotThe avatar Aug 30 '23 18:08 slotThe

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 avatar Aug 30 '23 19:08 geekosaur

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

geekosaur avatar Aug 30 '23 19:08 geekosaur