xmonad / xmonad-contrib

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

X.U.NamedScratchpads: Add dynamic scratchpad capabilities #690

Closed slotThe closed 2 years ago

slotThe commented 2 years ago

Description

Supersedes/Closes: https://github.com/xmonad/xmonad-contrib/pull/662

This is a first stab at making X.U.NamedScratchpads a little bit more general (while trying as hard as possible to retain backwards compatibility :/).

Summary of Commits

X.U.NamedScratchpad: Use ExtensibleState to store scratchpads

Instead of using the scratchpads that the user specifies (as this will realistically just be "all of them"), create some extensible state for the scratchpads to reside in.

To ensure that this is done in a backwards compatible way, function signatures did not change and they instead just ignore the list of scratchpads given to them and the initialisation is done in the manageHook, which users already have to use anyways.

X.U.NamedScratchpad: Add support for dynamic scratchpads

With the extensible state machinery in place1, we are now able to seamlessly integrate dynamic scratchpad functionality into X.U.NamedScratchpad. This is one step into the direction of having a single scratchpad implementation that can "do anything".

Related: https://github.com/xmonad/xmonad-contrib/issues/591 Related: https://github.com/xmonad/xmonad-contrib/pull/662

 (X.U.NamedScratchpad: Use ExtensibleState to store scratchpads)
X.U.DynamicScratchpads: Deprecate

Checklist

slotThe commented 2 years ago

I'm semi-happy with this (certainly happier than with a standalone DynamicScratchpads module), so I will merge in a bit if there are no further objections