<br><div class="gmail_quote">On Fri, Mar 28, 2008 at 2:45 PM, Anze Slosar <<a href="mailto:anze@berkeley.edu">anze@berkeley.edu</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
How can I bind certain layouts to key combinations? So rather than cycle<br>
thorugh layouts with Mod Space, I'd like Mod F1 to give me layout 1, Mod<br>
F2 to give me layout 2, etc... I've been googling for a bit, but can't<br>
find an answer.<br>
<br>
Thanks.<br>
<br>
anze<br>
</blockquote><div><br>Hi Anze,<br><br>You can do this using the JumpToLayout message from the XMonad.Layout.LayoutCombinators extension module. For example:<br><br>import XMonad hiding ( (|||) ) -- don't use the normal ||| operator<br>
import XMonad.Layout.LayoutCombinators -- use the one from LayoutCombinators instead<br>import XMonad.Util.EZConfig -- add keybindings easily<br><br>main = xmonad myConfig<br><br>myConfig = defaultConfig {<br> ...<br>
layoutHook = tall ||| Mirror tall ||| Full<br></div></div> ...<br>} `additionalKeysP`<br> [ ("M-<F1>", sendMessage $ JumpToLayout "Tall")<br> , ("M-<F2>", sendMessage $ JumpToLayout "Mirror Tall")<br>
, ("M-<F3>", sendMessage $ JumpToLayout "Full")<br> ]<br><br>tall = Tall 1 (3/100) (1/2)<br><br><br><br>Untested, but that's the basic idea, hopefully that will get you going on the right track. Let us know if you've got more questions.<br>
<br>-Brent<br>