Skip to content

Instantly share code, notes, and snippets.

@Brettm12345
Created December 6, 2019 06:19
Show Gist options
  • Save Brettm12345/6f2345ed397f89261a6873cb46fd160d to your computer and use it in GitHub Desktop.
Save Brettm12345/6f2345ed397f89261a6873cb46fd160d to your computer and use it in GitHub Desktop.
XMonad Layouts
{-# OPTIONS -fno-warn-missing-signatures #-}
module Container.Layout
( layout
)
where
import XMonad ( (|||) )
import XMonad.Layout ( Full(..) )
import XMonad.Hooks.ManageDocks ( avoidStruts )
import XMonad.Layout.BinarySpacePartition
( emptyBSP )
import XMonad.Layout.Fullscreen ( fullscreenFull )
import XMonad.Layout.IfMax ( IfMax(..) )
import XMonad.Layout.Named ( named )
import XMonad.Layout.NoBorders ( noBorders
, smartBorders
)
import XMonad.Layout.Gaps ( Gaps )
import XMonad.Layout.Spacing ( Spacing )
import XMonad.Layout.LayoutModifier ( ModifiedLayout )
import XMonad.Layout.ResizableTile ( ResizableTall(..) )
import XMonad.Layout.SimpleFloat ( simpleFloat )
import XMonad.Layout.TwoPane ( TwoPane(..) )
import XMonad.Layout.ThreeColumns ( ThreeCol(ThreeColMid) )
import Theme.Gaps ( gaps
, spacing
)
-- | Spacing function. Adds gaps and scpace around screen
space :: l a -> ModifiedLayout Gaps (ModifiedLayout Spacing l) a
space = gaps . spacing
-- No type definitions because I can't figure out how to simplify it
layout = avoidStruts . smartBorders $ layouts
where
twp =
named "Two Pane" $ IfMax 1 simpleFloat $ space $ TwoPane (3 / 100) (1 / 2)
full = named "Fullscreen" $ noBorders (fullscreenFull Full)
bsp = named "Binary Partition" $ IfMax 1 simpleFloat $ space emptyBSP
tall =
named "Tall" $ IfMax 1 full $ space $ ResizableTall 1 (2 / 100) (1 / 2) []
tcm = named "Three Columns" $ IfMax 1 simpleFloat $ space $ ThreeColMid
1
(3 / 100)
(1 / 2)
layouts = twp ||| tcm ||| bsp ||| tall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment