From 52ef05e73234cecb0ba21253915898f6d2dcffea Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Wed, 13 Apr 2022 16:51:18 +0300 Subject: [PATCH] refac(prog/xmonad): add grid layout for easy motion --- programs/xmonad/xmonad.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/programs/xmonad/xmonad.hs b/programs/xmonad/xmonad.hs index 749c0c2..3072750 100644 --- a/programs/xmonad/xmonad.hs +++ b/programs/xmonad/xmonad.hs @@ -10,19 +10,21 @@ import Data.Monoid import System.Exit import XMonad -import XMonad.Actions.EasyMotion (selectWindow) +import XMonad.Actions.CycleSelectedLayouts (cycleThroughLayouts) +import XMonad.Actions.EasyMotion (selectWindow) import XMonad.Hooks.DynamicLog import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.ManageDocks import XMonad.Hooks.StatusBar import XMonad.Hooks.StatusBar.PP +import XMonad.Layout.Grid import XMonad.Layout.NoBorders import XMonad.Layout.PerWorkspace import XMonad.Util.EZConfig import XMonad.Util.Run -import qualified Data.Map as M -import qualified XMonad.StackSet as W +import qualified Data.Map as M +import qualified XMonad.StackSet as W -- The preferred terminal program, which is used in a binding below and by -- certain contrib modules. @@ -82,7 +84,8 @@ myKeys conf = mkKeymap conf $ , ("M-S-c", kill) -- Rotate through the available layout algorithms - , ("M-", sendMessage NextLayout) + , ("M-", cycleThroughLayouts ["Full", "Tall"]) + , ("M-", sendMessage $ JumpToLayout "Grid") -- Reset the layouts on the current workspace to default , ("M-S-", setLayout $ XMonad.layoutHook conf) @@ -185,9 +188,9 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList -- which denotes layout choice. -- myLayout = avoidStruts - $ onWorkspace "web" (myTall (1/2) ||| myFull) + $ onWorkspace "web" (myTall (1/2) ||| myFull ||| Grid) $ onWorkspace "chat" (myTall (1/2)) - $ myTall (2/3) ||| myFull + $ myTall (2/3) ||| myFull ||| Grid where myTall = smartBorders . Tall nmaster delta