vanadium/xmonad: refactor

This commit is contained in:
Primrose 2025-11-05 08:54:06 +08:00
parent 073078a922
commit d243e6c32f
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
5 changed files with 10 additions and 12 deletions

View file

@ -0,0 +1,26 @@
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
module XMonad.Layout.ResizableTile.FixDescription
( RTFixDescription(..)
) where
import XMonad
import qualified XMonad.StackSet as W
import XMonad.Layout.ResizableTile
newtype RTFixDescription a = RTFixDescription { unwrapRT :: ResizableTall a }
deriving (Read, Show)
instance LayoutClass RTFixDescription a where
runLayout (W.Workspace t l s) =
let ws' = W.Workspace t (unwrapRT l) s
in fmap (fmap (fmap RTFixDescription))
. runLayout ws'
handleMessage (RTFixDescription l) m =
fmap (fmap RTFixDescription)
$ handleMessage l m
description (RTFixDescription l) =
description l <> " " <> show (_nmaster l)