[xmonad] A proper way to make XMonad.Actions.WindowMenu configurable?

Michal J. wlst-xmonad at zruze.cz
Sun Apr 5 20:49:53 UTC 2020


Hi Brandon,

>    For what it's worth, you normally get the XConf via `ask`
>    (Control.Monad.Reader) instead of passing it around. The primary
>    exception is in ManageHooks, which have a different Reader on top and
>    you must use `liftX` first to get at the other one.

Thanks for the clarification.

I think it'll take me a bit more work (after finishing the "wikibook"
about Haskell I started yesterday) to truly understand all this.

I mean, I still don't understand how one goes from `X ()` to bunch of
other -- more specific -- subtypes, but at this point I have a feeling
that a few more (tens of) hours of study will get me there.

>    Your own actions would not normally be part of the XConf or XConfig,
>    but a separate type which you would pass around.

Yeah, another kind soul at SO pointed out my folly:
https://stackoverflow.com/a/61019840/1177128
and basically told me how to convert my (apparently "bonkers") solution
into something that's more understandable (and ~matches what you said):

```haskell
-- details at the abovementioned link
defaultActions :: X [(String, X ())]
windowMenu' :: [(String, X ())] -> X ()

windowMenu :: X ()
windowMenu = defaultActions >>= windowMenu'
```

> Compare something like XMonad.Prompt and its `XPConfig` type.

Thanks for the pointer. :-)

Cheers,

Michal


More information about the xmonad mailing list