Use named layouts

master
Hektor Misplon 2023-06-02 22:22:42 +02:00
parent 00defddeb7
commit 9fcd70f47a
1 changed files with 15 additions and 41 deletions

View File

@ -44,18 +44,10 @@ pp =
ppHidden = secondaryColor, ppHidden = secondaryColor,
ppHiddenNoWindows = tertiaryColor, ppHiddenNoWindows = tertiaryColor,
ppUrgent = red . wrap (yellow "!") (yellow "!"), ppUrgent = red . wrap (yellow "!") (yellow "!"),
ppLayout = \l -> case l of ppLayout = id,
"Tall" -> "[]="
"Magnifier Tall" -> "[]+"
"Magnifier (off) Tall" -> "[]="
"Magnifier Mirror Tall" -> "+[]"
"Magnifier (off) Mirror Tall" -> "=[]"
"Full" -> "[ ]"
"ThreeCol" -> "|||"
_ -> l,
ppTitle = shorten 80, ppTitle = shorten 80,
ppTitleSanitize = xmobarStrip, ppTitleSanitize = xmobarStrip,
ppOrder = \[ws, l, _, wins] -> [ws, l, wins], ppOrder = \[workspaces, layout, windows, _] -> [workspaces, layout, windows],
ppExtras = [logTitles formatFocused formatUnfocused] ppExtras = [logTitles formatFocused formatUnfocused]
} }
where where
@ -104,24 +96,16 @@ myManageHook =
-- layoutHook -- layoutHook
myLayoutHook = myLayoutHook =
-- smartBorders $ showWName' myShowWNameConfig $
-- Tiled layouts t ||| -- Tiled layouts
tiled c3 ||| -- Column layouts
-- -- Note: magnifier is off by default c3m ||| --
-- -- (controllable usingarrow keys) f -- Monocle layouts
-- ||| magnifiercz magnificationFactorH tiled
-- ||| magnifiercz magnificationFactorV (Mirror tiled)
-- Single window / monocle layout
-- Column layouts
-- ||| threeColMid
-- Monocle layouts
||| Full
where where
magnificationFactorV = 1.384 t = renamed [Replace "[]+"] $ centeredIfSingle 0.8 0.9 $ Tall nmaster delta ratio
magnificationFactorH = 1.621 c3 = renamed [Replace "|||"] $ ThreeCol nmaster delta ratio
tiled = Tall nmaster delta ratio c3m = renamed [Replace "[|]"] $ ThreeColMid nmaster delta ratio
threeCol = ThreeCol nmaster delta ratio f = renamed [Replace "[+]"] Full
threeColMid = ThreeColMid nmaster delta ratio
nmaster = 1 nmaster = 1
ratio = 1 / 2 ratio = 1 / 2
delta = 4 / 100 delta = 4 / 100
@ -200,21 +184,11 @@ myKeysP =
(k, w) <- zip myWorkspaceKeys (withScreen 0 myWorkspaces) ++ zip mySharedWorkspaceKeys (withScreen 1 mySharedWorkspaces) (k, w) <- zip myWorkspaceKeys (withScreen 0 myWorkspaces) ++ zip mySharedWorkspaceKeys (withScreen 1 mySharedWorkspaces)
] ]
zipKeyPrefixes :: [String] -> [String] -> [String]
zipKeyPrefixes prefixes keys = [prefix ++ key | prefix <- prefixes, key <- keys]
-- Keybindings to be removed -- Keybindings to be removed
myRemoveKeysP = myRemoveKeysP = "M-S-q" : zipKeyPrefixes ["M-", "M-S-"] (map show [ 1..5 ])
[ -- Remove 1,2,3,4,5 bindings for workspaces
"M-1",
"M-2",
"M-3",
"M-4",
"M-5",
-- Remove shift + 1,2,3,4,5 bindings for workspaces
"M-S-1",
"M-S-2",
"M-S-3",
"M-S-4",
"M-S-5"
]
-- main :: IO () -- main :: IO ()
main = do xmonad main = do xmonad