aboutsummaryrefslogtreecommitdiffstats
path: root/SinkAll.hs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--SinkAll.hs34
1 files changed, 34 insertions, 0 deletions
diff --git a/SinkAll.hs b/SinkAll.hs
new file mode 100644
index 0000000..16d6637
--- /dev/null
+++ b/SinkAll.hs
@@ -0,0 +1,34 @@
+-----------------------------------------------------------------------------
+-- |
+-- Module : XmonadContrib.SinkAll
+-- License : BSD3-style (see LICENSE)
+-- Stability : unstable
+-- Portability : unportable
+--
+-- Provides a simple binding that pushes all floating windows on the current
+-- workspace back into tiling.
+-----------------------------------------------------------------------------
+
+module XMonadContrib.SinkAll (
+ -- * Usage
+ -- $usage
+ sinkAll) where
+
+import Operations
+import XMonad
+import StackSet hiding (sink)
+
+import Control.Monad.State
+import Graphics.X11.Xlib
+
+-- $usage
+-- > import XMonadContrib.SinkAll
+-- > keys = [ ((modMask .|. shiftMask, xK_t), sinkAll) ]
+
+sinkAll :: X ()
+sinkAll = withAll sink
+
+-- Apply a function to all windows on current workspace.
+withAll :: (Window -> X a) -> X ()
+withAll f = gets (integrate' . stack . workspace . current . windowset) >>=
+ mapM_ f