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