Refactor xmonad.hs, add Mirrored Tall layout

This commit is contained in:
Ivan Malison 2016-09-15 16:57:12 -07:00
parent e2c9c11131
commit 318fc35455
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -1,42 +1,43 @@
import XMonad import XMonad
import XMonad.Config() import XMonad.Config ()
import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageDocks
import XMonad.Layout.MultiToggle import XMonad.Layout.MultiToggle
import XMonad.Util.CustomKeys
import XMonad.Layout.MultiToggle.Instances import XMonad.Layout.MultiToggle.Instances
import XMonad.Layout.NoBorders import XMonad.Layout.NoBorders
import XMonad.Layout.Spacing import XMonad.Layout.Spacing
import XMonad.Layout.ThreeColumns import XMonad.Layout.ThreeColumns
import XMonad.Util.EZConfig
-- Use Super/Command/WinKey instead of Alt
myModMask :: KeyMask
myModMask = mod4Mask
main :: IO ()
main = xmonad $ ewmh def main = xmonad $ ewmh def
{ modMask = myModMask { modMask = mod4Mask
, terminal = "urxvt" , terminal = "urxvt"
, manageHook = manageDocks <+> manageHook def , manageHook = manageDocks <+> manageHook def
, layoutHook = myLayoutHook , layoutHook = myLayoutHook
-- , logHook = myLogHook topBar -- , logHook = myLogHook topBar
, handleEventHook = handleEventHook def <+> fullscreenEventHook , handleEventHook = handleEventHook def <+> fullscreenEventHook
, startupHook = myStartup , startupHook = myStartup
} `additionalKeys` , keys = customKeys delKeys addKeys
[ ((myModMask, xK_p), spawn "rofi -show drun") }
, ((myModMask, xK_g), spawn "rofi -show window")
-- TODO: Change this to bringing the window to the current workspace delKeys _ = []
, ((myModMask, xK_b), spawn "rofi -show run")
, ((myModMask .|. controlMask, xK_space), sendMessage $ Toggle FULL) addKeys XConfig {modMask = modm} =
] [ ((modm, xK_p), spawn "rofi -show drun")
, ((modm, xK_g), spawn "rofi -show window")
-- , ((modm, xK_s), sequence_ [shiftNextScreen, nextScreen])
-- TODO: Change this to bringing the window to the current workspace
, ((modm, xK_b), spawn "rofi -show run")
, ((modm .|. controlMask, xK_space), sendMessage $ Toggle FULL)
]
layouts = tiled ||| ThreeCol 1 (3/100) (1/3) ||| Mirror tiled
where
tiled = Tall 1 (3/100) (1/2)
myLayoutHook = avoidStruts . smartSpacing 10 . noBorders myLayoutHook = avoidStruts . smartSpacing 10 . noBorders
. mkToggle (FULL ?? EOT) $ . mkToggle (FULL ?? EOT) $ layouts
Tall 1 (3/100) (1/2) ||| ThreeCol 1 (3/100) (1/3)
myStartup :: X()
myStartup = do myStartup = do
spawn "nm-applet --sm-disable" spawn "nm-applet --sm-disable"
spawn "xsetroot -solid black" spawn "xsetroot -solid black"