xmonad: add constansts for layout ids

This commit is contained in:
Dmitriy Pleshevskiy 2023-03-14 12:53:08 +03:00
parent f04cae86eb
commit d7dfeb35fd
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985

View file

@ -163,9 +163,9 @@ myPolybarLogHook dbus = myLogHook <+> dynamicLogWithPP (polybarHook dbus)
--
myLayoutHook = mirrorTiled ||| tiled ||| full
where
full = layout "Full" Full
tiled = layout "Tall" baseTiled
mirrorTiled = layout "Mirror Tall" $ Mirror baseTiled
full = layout fullLayoutId Full
tiled = layout tallLayoutId baseTiled
mirrorTiled = layout mirrorTallLayoutId $ Mirror baseTiled
layout n l = renamed [Replace n] $ avoidStruts . smartBorders . minimize . boringWindows $ l
@ -177,6 +177,10 @@ myLayoutHook = mirrorTiled ||| tiled ||| full
gapSpaced g = spacing g . myGaps g
myGaps gap = gaps [(U, gap), (D, gap), (L, gap), (R, gap)]
fullLayoutId = "Full"
tallLayoutId = "Tall"
mirrorTallLayoutId = "Mirror Tall"
------------------------------------------------------------------------
-- Startup hook
@ -308,8 +312,8 @@ myKeys conf =
layout_kb =
[ -- Rotate through the available layout algorithms
-- ("M-<Space>", sendMessage NextLayout),
("M-<Space>", cycleThroughLayouts ["Full", "Mirror Tall"]),
("M-<Tab>", cycleThroughLayouts ["Tall", "Mirror Tall"]),
("M-<Space>", cycleThroughLayouts [fullLayoutId, mirrorTallLayoutId]),
("M-<Tab>", cycleThroughLayouts [tallLayoutId, mirrorTallLayoutId]),
-- Reset the layouts on the current workspace to default
("M-S-<Space>", setLayout $ XMonad.layoutHook conf),
-- Shrink the master area