mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
37 lines
1.0 KiB
Haskell
37 lines
1.0 KiB
Haskell
-----------------------------------------------------------------------------
|
|
-- |
|
|
-- 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
|
|
|
|
import Graphics.X11.Xlib
|
|
|
|
-- $usage
|
|
-- > import XMonadContrib.SinkAll
|
|
-- > keys = [ ((modMask .|. shiftMask, xK_t), sinkAll) ]
|
|
|
|
-- %import XMonadContrib.SinkAll
|
|
-- %keybind , ((modMask .|. shiftMask, xK_t), sinkAll)
|
|
|
|
sinkAll :: X ()
|
|
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'
|