about summary refs log tree commit diff
path: root/src/XMonad/Custom/Layout.hs
blob: 8f14926bd5ac2ac055628b58388b5aedf9495c99 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{-# LANGUAGE DeriveDataTypeable    #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeSynonymInstances  #-}

module XMonad.Custom.Layout
    ( layoutHook'
    , Transformers (..)
    ) where

import           XMonad
import           XMonad.Custom.Theme
import           XMonad.Hooks.ManageDocks
import           XMonad.Layout.Accordion
import           XMonad.Layout.BinarySpacePartition
import           XMonad.Layout.Fullscreen
import           XMonad.Layout.Gaps
import           XMonad.Layout.Hidden
import           XMonad.Layout.LayoutModifier
import           XMonad.Layout.MultiToggle
import           XMonad.Layout.MultiToggle.Instances
import           XMonad.Layout.NoBorders
import           XMonad.Layout.Reflect
import           XMonad.Layout.Simplest
import           XMonad.Layout.Spacing
import           XMonad.Layout.SubLayouts
import           XMonad.Layout.Tabbed
import           XMonad.Layout.WindowNavigation

applySpacing :: l a -> ModifiedLayout Spacing l a
applySpacing = spacing gapBase

applyGaps :: l a -> ModifiedLayout Gaps l a
applyGaps = gaps [ (U, gapBase)
                 , (D, gapBase)
                 , (R, gapBase)
                 , (L, gapBase)
                 ]

data Transformers = GAPS
                  deriving (Read, Show, Eq, Typeable)

instance Transformer Transformers Window where
    transform GAPS x k = k (avoidStruts $ applyGaps $ applySpacing x) (const x)

layoutHook' = fullscreenFloat
            $ lessBorders OnlyFloat
            $ mkToggle (single NBFULL)
            $ avoidStruts
            $ mkToggle (single GAPS)
            $ mkToggle (single REFLECTX)
            $ mkToggle (single REFLECTY)
            $ windowNavigation
            $ addTabs shrinkText tabTheme
            $ hiddenWindows
            $ subLayout [] (Simplest ||| Accordion)
              emptyBSP

Consider giving Nix/NixOS a try! <3