From f0a9c1e63cd9e0ae23eb278692c8e5131456f96d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=83=E4=BD=8F=E6=9F=B1=E9=96=93?= Date: Sat, 16 Mar 2024 15:41:42 +0000 Subject: [PATCH] mirrored layout --- xmonad/xmonad.hs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs index b629762..60f64c6 100644 --- a/xmonad/xmonad.hs +++ b/xmonad/xmonad.hs @@ -36,6 +36,9 @@ import XMonad.Actions.PerWindowKeys import XMonad.Actions.FindEmptyWorkspace import XMonad.Layout.Grid import XMonad.Layout.PerScreen (ifWider) +import XMonad.StackSet +import XMonad.Layout +import XMonad.Layout.Reflect main :: IO () @@ -80,6 +83,7 @@ myConfig = def , ("M-f", viewEmptyWorkspace) -- View an empty workspace , ("M-S-w", spawn "flameshot gui --path=/mnt/Data/mpv-screenshots/screenshots") , ("M-w", spawn "~/.local/bin/copy_image.sh") + , ("M-v", toggleLayout) ] @@ -97,13 +101,18 @@ myTheme = def -- Add other theme properties as needed } - - - myLayout = mouseResize $ spacingRaw True (Border 10 10 10 10) True (Border 10 10 10 10) True $ tallLayout ||| Full where - tallLayout = Tall 2 (3/100) (1/2) + tallLayout = reflectHoriz $ Tall 2 (3/100) (1/2) + +toggleLayout :: X () +toggleLayout = do + currentLayout <- gets (W.layout . W.workspace . W.current . windowset) + case description currentLayout of + "Tall" -> sendMessage $ JumpToLayout "Mirror Tall" + _ -> sendMessage $ JumpToLayout "Tall" + myXmobarPP :: PP myXmobarPP = def