vanadium/xmonad: show nmaster count in description

This commit is contained in:
Primrose 2025-11-04 10:50:29 +08:00
parent b123f1650d
commit 073078a922
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
4 changed files with 35 additions and 4 deletions

View file

@ -0,0 +1,29 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Leanamonad.Layout.ReflectMsg where
import XMonad (
Resize (Expand, Shrink),
SomeMessage (SomeMessage),
fromMessage,
)
import XMonad.Layout.LayoutModifier (
LayoutModifier (handleMess, handleMessOrMaybeModifyIt),
ModifiedLayout (ModifiedLayout),
)
data ReflectMsg a = ReflectMsg deriving (Show, Read)
reflectMsg :: l a -> ModifiedLayout ReflectMsg l a
reflectMsg = ModifiedLayout ReflectMsg
instance LayoutModifier ReflectMsg a where
handleMessOrMaybeModifyIt m mess
| Just Shrink <- fromMessage mess = return . Just . Right $ SomeMessage Expand
| Just Expand <- fromMessage mess = return . Just . Right $ SomeMessage Shrink
-- Handle the rest by passing it on
| otherwise = do
mm <- handleMess m mess
return (Left <$> mm)