[xmonad] Change Layout Using a Hotkey

Brandon Allbery allbery.b at gmail.com
Fri May 3 02:04:00 CEST 2013


Oh, I gave you half the answer but not the other half. It would be
something along the lines of (setLayout $ Layout $ layout goes here).

Note the shortcomings, though:

- if you want layout modifiers, they must be included here; there is no way
to apply the layoutHook's layout modifiers to something not in the
layoutHook.
- layouts store state in their constructors in the layoutHook. This state
will probably be inaccessible.
- the layout and its state will be lost across mod-q because only the
layoutHook is saved across invocations. No, it is not possible to save the
keybindings on the off chance that someone hid a layout inside them.
- layout modifiers with runtime behavior, as a result of the above, will
either not have that behavior or will malfunction in various ways.
(Example: mod-b to toggle struts would only toggle them in the layoutHook.
- some runtime behavior is accomplished via sending messages to layouts.
This, again, expects those layouts to be reachable via the manageHook, and
often requires some state. At the very least, I expect broadcast messages
will not reach your layout.
- other things that know that the layout is reachable from layoutHook will
break. I'm not thinking of any off the top of my head, but it's not
unlikely that something in the xmonad core cares.
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20130502/7be4e11d/attachment.htm>


More information about the xmonad mailing list