xmonad: rename layouts

This commit is contained in:
Dmitriy Pleshevskiy 2023-03-14 12:39:55 +03:00
parent 8f6c1dfcc4
commit 62dc7077d4
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985

View file

@ -42,6 +42,7 @@ import XMonad.Layout.LimitWindows (limitWindows)
import XMonad.Layout.NoBorders (smartBorders) import XMonad.Layout.NoBorders (smartBorders)
import XMonad.Layout.Spacing (spacing) import XMonad.Layout.Spacing (spacing)
import XMonad.Layout.Minimize (minimize) import XMonad.Layout.Minimize (minimize)
import XMonad.Layout.Renamed (renamed, Rename (..))
import XMonad.Prompt (XPConfig (..), XPPosition (Top), XPType (..), XPrompt (..), mkComplFunFromList', mkXPromptWithModes) import XMonad.Prompt (XPConfig (..), XPPosition (Top), XPType (..), XPrompt (..), mkComplFunFromList', mkXPromptWithModes)
import qualified XMonad.StackSet as W import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig import XMonad.Util.EZConfig
@ -160,11 +161,15 @@ myPolybarLogHook dbus = myLogHook <+> dynamicLogWithPP (polybarHook dbus)
-- The available layouts. Note that each layout is separated by |||, -- The available layouts. Note that each layout is separated by |||,
-- which denotes layout choice. -- which denotes layout choice.
-- --
myLayoutHook = minimize . boringWindows . avoidStruts . smartBorders $ (Mirror tiled ||| tiled ||| full) myLayoutHook = mirrorTiled ||| tiled ||| full
where where
full = Full full = layout "Full" Full
tiled = gapSpaced 5 $ Tall nmaster incRatio ratio tiled = layout "Tall" baseTiled
mirrorTiled = layout "Mirror Tall" $ Mirror baseTiled
layout n l = renamed [Replace n] $ avoidStruts . smartBorders . minimize . boringWindows $ l
baseTiled = gapSpaced 5 $ Tall nmaster incRatio ratio
nmaster = 1 nmaster = 1
incRatio = (3 / 100) incRatio = (3 / 100)
ratio = (1 / 2) ratio = (1 / 2)
@ -302,8 +307,9 @@ myKeys conf =
layout_kb = layout_kb =
[ -- Rotate through the available layout algorithms [ -- Rotate through the available layout algorithms
-- ("M-<Space>", sendMessage NextLayout),
("M-<Space>", cycleThroughLayouts ["Full", "Mirror Spacing Tall"]), ("M-<Space>", cycleThroughLayouts ["Full", "Mirror Spacing Tall"]),
("M-<Tab>", cycleThroughLayouts ["Spacing Tall", "Mirror Spacing Tall"]), ("M-<Tab>", cycleThroughLayouts ["Tall", "Mirror Tall"]),
-- 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