From a48bb7af70d633b3d9b88f7e8e812dcbf14cfd4a Mon Sep 17 00:00:00 2001 From: Braden Shepherdson Date: Sun, 6 Jul 2008 18:08:47 +0200 Subject: Added ewmhLogHookCustom, which allows arbitrary transformation of the workspace list. darcs-hash:20080706160847-d53a8-2b6ded39b1f4da02e9bfd52d9ccaf7d05829b517.gz --- XMonad/Hooks/EwmhDesktops.hs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs index 7984dff..a0d6689 100644 --- a/XMonad/Hooks/EwmhDesktops.hs +++ b/XMonad/Hooks/EwmhDesktops.hs @@ -17,6 +17,7 @@ module XMonad.Hooks.EwmhDesktops ( -- $usage EwmhDesktopsHook, ewmhDesktopsLogHook, + ewmhDesktopsLogHookCustom, ewmhDesktopsLayout ) where @@ -53,13 +54,23 @@ import XMonad.Hooks.EventHook -- -- "XMonad.Doc.Extending#Editing_the_layout_hook" + + + -- | -- Notifies pagers and window lists, such as those in the gnome-panel -- of the current state of workspaces and windows. ewmhDesktopsLogHook :: X () -ewmhDesktopsLogHook = withWindowSet $ \s -> do +ewmhDesktopsLogHook = ewmhDesktopsLogHookCustom id + + +-- | +-- Generalized version of ewmhDesktopsLogHook that allows an arbitrary +-- user-specified function to transform the workspace list (post-sorting) +ewmhDesktopsLogHookCustom :: ([WindowSpace] -> [WindowSpace]) -> X () +ewmhDesktopsLogHookCustom f = withWindowSet $ \s -> do sort' <- getSortByIndex - let ws = sort' $ W.workspaces s + let ws = f $ sort' $ W.workspaces s setSupported -- cgit v1.2.3