feat: add floating layout

This commit is contained in:
♥ Minnie ♥ 2025-09-01 18:50:52 +08:00
parent 55a116d47b
commit acce09747d
Signed by: jasmine
GPG key ID: 8563E358D4E8040E

View file

@ -12,6 +12,7 @@ import XMonad.Hooks.StatusBar
import XMonad.Layout.BinarySpacePartition
import XMonad.Layout.NoBorders
import XMonad.Layout.Renamed
import XMonad.Layout.SimpleFloat
import XMonad.Layout.Spacing
import XMonad.StackSet qualified as W
import XMonad.Util.EZConfig
@ -86,8 +87,9 @@ myKeymap =
-- toggling layouts
, ("M-a <Backspace> t", sendMessage $ JumpToLayout "dynamic tiling" )
, ("M-a <Backspace> b", sendMessage $ JumpToLayout "binary space partition")
, ("M-a <Backspace> f", sendMessage $ JumpToLayout "floating" )
, ("M-a <Backspace> m", sendMessage $ JumpToLayout "maximised" )
, ("M-a <Backspace> f", sendMessage $ JumpToLayout "fullscreen" )
, ("M-a <Backspace> F", sendMessage $ JumpToLayout "fullscreen" )
-- enable modal modes
, ("M-a m e", setMode "edit")
@ -205,11 +207,12 @@ editMode = mode "edit" $ mkKeysEz
-- Layouts
--
myLayouts = myTile ||| myBsp ||| myMax ||| myFull
myLayouts = myTile ||| myBsp ||| myFloat ||| myMax ||| myFull
where
-- our layouts
myTile = renamed [Replace "dynamic tiling" ] . avoidStruts . myGaps $ Tall nmaster delta ratio
myBsp = renamed [Replace "binary space partition"] . avoidStruts . myGaps $ emptyBSP
myFloat = renamed [Replace "floating" ] . avoidStruts $ simpleFloat
myMax = renamed [Replace "maximised" ] . avoidStruts . myGaps $ Full
myFull = renamed [Replace "fullscreen" ] . noBorders $ Full
-- add a configurable amount of space around windows.