nix/wm/xmonad: change layout

This commit is contained in:
Dmitriy Pleshevskiy 2022-08-25 17:12:21 +03:00
parent 536833d247
commit 60ac773718
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215

View file

@ -20,9 +20,12 @@ import XMonad.Hooks.ManageDocks
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.Layout.BoringWindows (boringWindows)
import XMonad.Layout.Gaps (gaps)
import XMonad.Layout.Grid
import XMonad.Layout.LimitWindows (limitWindows)
import XMonad.Layout.NoBorders
import XMonad.Layout.NoBorders (smartBorders)
import XMonad.Layout.Spacing (spacing)
import XMonad.Layout.ThreeColumns (ThreeCol (..))
import XMonad.Util.EZConfig
import XMonad.Util.Run
@ -49,7 +52,7 @@ myClickJustFocuses = False
-- Width of the window border in pixels.
--
myBorderWidth = 3
myBorderWidth = 2
-- modMask lets you specify which modkey you want to use. The default
-- is mod1Mask ("left alt"). You may also consider using mod3Mask
@ -72,7 +75,7 @@ myWorkspaces = ["web", "dev", "dev2", "dev3", "fin", "sys", "com"]
-- Border colors for unfocused and focused windows, respectively.
--
myNormalBorderColor = "#444"
myFocusedBorderColor = "#f00"
myFocusedBorderColor = "#2E9AFE"
main :: IO ()
main = mkDbusClient >>= main'
@ -153,13 +156,14 @@ myPolybarLogHook dbus = myLogHook <+> dynamicLogWithPP (polybarHook dbus)
-- The available layouts. Note that each layout is separated by |||,
-- which denotes layout choice.
--
myLayout = avoidStruts (myMirror (2/3) ||| myTall (1/2) ||| myFull ||| Grid)
myLayout = avoidStruts . smartBorders $ (Mirror tiled ||| tiled ||| column3 ||| full)
where
myMirror = limitWindows 5 . Mirror . myTall
full = Full
tiled = gapSpaced 5 $ Tall 1 (3/100) (1/2)
column3 = gapSpaced 5 $ ThreeColMid 1 (3/100) (1/2)
myTall = boringWindows . smartBorders . Tall 1 (3/100)
myFull = noBorders Full
gapSpaced g = spacing g . myGaps g
myGaps gap = gaps [(U, gap), (D, gap), (L, gap), (R, gap)]
------------------------------------------------------------------------
-- Startup hook
@ -242,8 +246,8 @@ myKeys conf = mkKeymap conf $
, ("M4-S-c", kill)
-- Rotate through the available layout algorithms
, ("M-<Space>", cycleThroughLayouts ["Full", "Mirror Tall"])
, ("M-<Tab>", cycleThroughLayouts ["Grid", "Tall", "Mirror Tall"])
, ("M-<Space>", cycleThroughLayouts ["Full", "Mirror Spacing Tall"])
, ("M-<Tab>", cycleThroughLayouts ["Spacing ThreeCol", "Spacing Tall", "Mirror Spacing Tall"])
-- Reset the layouts on the current workspace to default
, ("M-S-<Space>", setLayout $ XMonad.layoutHook conf)