From 1c0dbc793902f65ddb43f7a4e527c333d745e388 Mon Sep 17 00:00:00 2001 From: "joachim.fasting" Date: Sat, 23 Jun 2007 07:05:10 +0200 Subject: Add SinkAll module. Provides a means of pushing all windows on the current workspace back into tiling. Not all that useful, but might be preferable to restarting or manually pushing windows. darcs-hash:20070623050510-ea16c-d3a090a96f7dc4707b5e2c7b6cb9faab008ca35d.gz --- SinkAll.hs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 SinkAll.hs (limited to 'SinkAll.hs') 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 -- cgit v1.2.3