diff options
author | loupgaroublond <loupgaroublond@gmail.com> | 2008-12-21 23:48:50 +0100 |
---|---|---|
committer | loupgaroublond <loupgaroublond@gmail.com> | 2008-12-21 23:48:50 +0100 |
commit | 3ba5c6f5e274c2c909b579e647f62290c78e4351 (patch) | |
tree | d6b961dc4f972a862682799d88c6c9a990a0a593 /XMonad/Actions | |
parent | b32da8ae3aa77b7bfc98942bb45e3fb0cb67ddb8 (diff) | |
download | XMonadContrib-3ba5c6f5e274c2c909b579e647f62290c78e4351.tar.gz XMonadContrib-3ba5c6f5e274c2c909b579e647f62290c78e4351.tar.xz XMonadContrib-3ba5c6f5e274c2c909b579e647f62290c78e4351.zip |
adds generic 'all windows on current workspace' functionality
darcs-hash:20081221224850-3ec9f-5d9f001f4ffdf4c857d0fd68a2794ad42f9fc2c4.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r-- | XMonad/Actions/SinkAll.hs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/XMonad/Actions/SinkAll.hs b/XMonad/Actions/SinkAll.hs index 9d63f58..ada069a 100644 --- a/XMonad/Actions/SinkAll.hs +++ b/XMonad/Actions/SinkAll.hs @@ -12,9 +12,14 @@ module XMonad.Actions.SinkAll ( -- * Usage -- $usage - sinkAll) where + sinkAll, withAll, + withAll', killAll) where + +import Data.Foldable hiding (foldr) import XMonad +import XMonad.Core +import XMonad.Operations import XMonad.StackSet -- $usage @@ -32,9 +37,16 @@ import XMonad.StackSet -- | Un-float all floating windows on the current workspace. sinkAll :: X () -sinkAll = withAll sink +sinkAll = withAll' sink -- | Apply a function to all windows on current workspace. -withAll :: (Window -> WindowSet -> WindowSet) -> X () -withAll f = windows $ \ws -> let all' = integrate' . stack . workspace . current $ ws - in foldr f ws all' +withAll' :: (Window -> WindowSet -> WindowSet) -> X () +withAll' f = windows $ \ws -> let all' = integrate' . stack . workspace . current $ ws + in foldr f ws all' + +withAll :: (Window -> X ()) -> X() +withAll f = withWindowSet $ \ws -> let all' = integrate' . stack . workspace . current $ ws + in forM_ all' f + +killAll :: X() +killAll = withAll killWindow
\ No newline at end of file |