Search code examples
xmonad

Configure XMonad Tall layout to expand all the way to the screen border


I use the XMonad Tall layout and can expand and shrink the master area with mod-l and mod-h.

Question: Is there a possibility to to expand the master area all the way to the border of the screen with one keystroke (instead of having to press mod-l serveral times?). Something like a full-screen key combination. Is there then even a reverse key combinations to get out of full-screen mode again. Does anyone know an example howto set this up? I think I could use the Full layout for this, however I want to avoid having to cycle though the layouts with mod-space. How can I bind a keycombination to select a specific layout? (i.e. mod-shift-l to cycle between Full and Tall layout only).


Solution

  • Found the answer:

    To toggle between Full-Layout and a set of other layouts, in my case Tall and Tabbed, I did:

    ...
    import XMonad.Layout.ToggleLayouts
    ...
    myLayout =  avoidStruts (
        toggleLayouts Full (
                      Tall 1 (10/100) (2/3) |||
                      tabbed shrinkText tabConfig
                      )
        )
    ...
    
      -- Switch to Full layout.
      , ((modMask .|. shiftMask, xK_l),
          sendMessage (Toggle "Full") )
    

    Then, by pressing mod-shift-l Fullscreen Layout is enabled and reverted the next time mod-shift-l is pressed. Snippet from https://gist.github.com/jianingy/5472640 , I dont have the slightest clue how Haskell works...