mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-16 16:11:15 +00:00
vanadium/xmonad: revamp layout algorithm
- Use threecol everywhere except - chat and multimedia: use grid / accordion
This commit is contained in:
parent
18418415d1
commit
1e63c7bb53
1 changed files with 43 additions and 19 deletions
|
|
@ -1,7 +1,9 @@
|
||||||
{-# LANGUAGE NegativeLiterals #-}
|
{-# LANGUAGE NegativeLiterals #-}
|
||||||
|
{-# OPTIONS_GHC -Wno-missing-signatures #-} -- my layout is getting crazy
|
||||||
|
|
||||||
import XMonad
|
import XMonad
|
||||||
import XMonad.Actions.CopyWindow
|
import XMonad.Actions.CopyWindow
|
||||||
|
import XMonad.Actions.PerWorkspaceKeys
|
||||||
import XMonad.Actions.Submap
|
import XMonad.Actions.Submap
|
||||||
import XMonad.Actions.SwapWorkspaces
|
import XMonad.Actions.SwapWorkspaces
|
||||||
import XMonad.Hooks.DynamicLog
|
import XMonad.Hooks.DynamicLog
|
||||||
|
|
@ -12,19 +14,23 @@ import XMonad.Hooks.ManageHelpers
|
||||||
import XMonad.Hooks.OnPropertyChange
|
import XMonad.Hooks.OnPropertyChange
|
||||||
import XMonad.Hooks.RefocusLast
|
import XMonad.Hooks.RefocusLast
|
||||||
import XMonad.Hooks.StatusBar
|
import XMonad.Hooks.StatusBar
|
||||||
import XMonad.Layout.FocusTracking
|
import XMonad.Layout.Accordion
|
||||||
|
import XMonad.Layout.Grid
|
||||||
|
import XMonad.Layout.IfMax
|
||||||
|
import XMonad.Layout.LimitWindows
|
||||||
|
import XMonad.Layout.Maximize
|
||||||
import XMonad.Layout.NoBorders
|
import XMonad.Layout.NoBorders
|
||||||
import XMonad.Layout.Reflect
|
import XMonad.Layout.PerWorkspace
|
||||||
import XMonad.Layout.Reflect.Message
|
|
||||||
import XMonad.Layout.Renamed
|
import XMonad.Layout.Renamed
|
||||||
import XMonad.Layout.ResizableTile
|
import XMonad.Layout.ResizableTile
|
||||||
import XMonad.Layout.Spacing
|
import XMonad.Layout.Spacing
|
||||||
|
import XMonad.Layout.ThreeColumns
|
||||||
|
import XMonad.Layout.ToggleLayouts
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
import XMonad.Util.EZConfig
|
import XMonad.Util.EZConfig
|
||||||
import XMonad.Util.Hacks
|
import XMonad.Util.Hacks
|
||||||
import XMonad.Util.NamedScratchpad
|
import XMonad.Util.NamedScratchpad
|
||||||
import XMonad.Util.SpawnOnce
|
import XMonad.Util.SpawnOnce
|
||||||
import XMonad.Layout.Magnifier
|
|
||||||
|
|
||||||
import Data.Char.Greek
|
import Data.Char.Greek
|
||||||
import Data.Ratio
|
import Data.Ratio
|
||||||
|
|
@ -62,14 +68,31 @@ main =
|
||||||
`additionalKeys` keybinds
|
`additionalKeys` keybinds
|
||||||
|
|
||||||
myLayout =
|
myLayout =
|
||||||
let tallr = renamed [ Replace "Tall" ]
|
avoidStruts
|
||||||
$ smartSpacingWithEdge 5
|
$ smartBorders
|
||||||
$ reflectMsg . reflectHoriz
|
$ onWorkspace chatWS (ifMaxToggle 2 grid accordion)
|
||||||
$ ResizableTall 1 (1/10) (3/7) []
|
$ onWorkspace multimediaWS (ifMaxToggle 2 grid accordion)
|
||||||
mag = magnifyxy 1.05 1.3 (NoMaster 3) False
|
-- Magifier doesn't work well with threecol's slaves
|
||||||
in avoidStruts
|
-- Full has the property of "only maximizing the focused one"
|
||||||
$ smartBorders
|
-- Maximize can have a window maximized but not focused, might be useful when programming
|
||||||
$ mag tallr ||| focusTracking Full
|
$ maximizeWithPadding 0 threecol
|
||||||
|
where
|
||||||
|
ifMaxToggle n tog l = ifMax n l (toggleLayouts tog l)
|
||||||
|
threecol =
|
||||||
|
renamed [ Replace "3Col" ]
|
||||||
|
$ smartSpacingWithEdge 5
|
||||||
|
$ ThreeColMid 1 (3/100) (1/2)
|
||||||
|
|
||||||
|
grid =
|
||||||
|
renamed [ Replace "Grid" ]
|
||||||
|
$ smartSpacingWithEdge 5
|
||||||
|
$ Grid
|
||||||
|
|
||||||
|
accordion =
|
||||||
|
renamed [ Replace "Accordion" ]
|
||||||
|
$ smartSpacingWithEdge 5
|
||||||
|
$ limitSlice 3
|
||||||
|
$ Accordion
|
||||||
|
|
||||||
isSioyek :: Query Bool
|
isSioyek :: Query Bool
|
||||||
isSioyek = className =? "sioyek"
|
isSioyek = className =? "sioyek"
|
||||||
|
|
@ -264,9 +287,6 @@ keybinds =
|
||||||
, ((0, xF86XK_AudioPlay), spawn "playerctl play-pause")
|
, ((0, xF86XK_AudioPlay), spawn "playerctl play-pause")
|
||||||
, ((0, xF86XK_AudioNext), spawn "playerctl next" )
|
, ((0, xF86XK_AudioNext), spawn "playerctl next" )
|
||||||
|
|
||||||
-- Toggle fullscreen
|
|
||||||
, ((superMask, xK_Escape), sendMessage NextLayout)
|
|
||||||
|
|
||||||
-- Resize windows
|
-- Resize windows
|
||||||
, ((superMask, xK_equal ), sendMessage $ IncMasterN 1)
|
, ((superMask, xK_equal ), sendMessage $ IncMasterN 1)
|
||||||
, ((superMask, xK_minus ), sendMessage $ IncMasterN -1)
|
, ((superMask, xK_minus ), sendMessage $ IncMasterN -1)
|
||||||
|
|
@ -274,7 +294,11 @@ keybinds =
|
||||||
, ((superMask, xK_period ), sendMessage Expand )
|
, ((superMask, xK_period ), sendMessage Expand )
|
||||||
, ((superMask .|. shiftMask, xK_comma ), sendMessage MirrorShrink )
|
, ((superMask .|. shiftMask, xK_comma ), sendMessage MirrorShrink )
|
||||||
, ((superMask .|. shiftMask, xK_period), sendMessage MirrorExpand )
|
, ((superMask .|. shiftMask, xK_period), sendMessage MirrorExpand )
|
||||||
, ((superMask , xK_apostrophe), sendMessage Toggle )
|
, ((superMask , xK_space ), chooseAction $ \ws ->
|
||||||
|
if ws == chatWS then sendMessage ToggleLayout
|
||||||
|
else if ws == multimediaWS then sendMessage ToggleLayout
|
||||||
|
else withFocused (sendMessage . maximizeRestore)
|
||||||
|
)
|
||||||
|
|
||||||
-- [D]o sink and lift
|
-- [D]o sink and lift
|
||||||
, ( (superMask, xK_d)
|
, ( (superMask, xK_d)
|
||||||
|
|
@ -343,12 +367,12 @@ altMask = mod1Mask
|
||||||
myWorkspaces :: [WorkspaceId]
|
myWorkspaces :: [WorkspaceId]
|
||||||
myWorkspaces = map (:[]) $ take 8 greekLower
|
myWorkspaces = map (:[]) $ take 8 greekLower
|
||||||
|
|
||||||
multimediaWS :: WorkspaceId
|
|
||||||
multimediaWS = myWorkspaces !! 6
|
|
||||||
|
|
||||||
chatWS :: WorkspaceId
|
chatWS :: WorkspaceId
|
||||||
chatWS = myWorkspaces !! 3
|
chatWS = myWorkspaces !! 3
|
||||||
|
|
||||||
|
multimediaWS :: WorkspaceId
|
||||||
|
multimediaWS = myWorkspaces !! 6
|
||||||
|
|
||||||
centeredFloat, smallFloat, fullFloat, buttomRightFloat :: W.RationalRect
|
centeredFloat, smallFloat, fullFloat, buttomRightFloat :: W.RationalRect
|
||||||
centeredFloat = W.RationalRect (1%9) (1%9) (7%9) (7%9)
|
centeredFloat = W.RationalRect (1%9) (1%9) (7%9) (7%9)
|
||||||
smallFloat = W.RationalRect (3%5) (3%5) (2%7) (2%7)
|
smallFloat = W.RationalRect (3%5) (3%5) (2%7) (2%7)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue