mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
39 lines
1.1 KiB
Haskell
39 lines
1.1 KiB
Haskell
-----------------------------------------------------------------------------
|
|
-- |
|
|
-- Module : Xmonad.Actions.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 XMonad.Actions.SinkAll (
|
|
-- * Usage
|
|
-- $usage
|
|
sinkAll) where
|
|
|
|
import XMonad.Operations
|
|
import XMonad
|
|
import XMonad.StackSet
|
|
|
|
import Graphics.X11.Xlib
|
|
|
|
-- $usage
|
|
-- > import XMonad.Actions.SinkAll
|
|
-- > keys x = [ ((modMask x .|. shiftMask, xK_t), sinkAll) ]
|
|
--
|
|
-- where 'x' is your XConfig.
|
|
|
|
-- %import XMonad.Actions.SinkAll
|
|
-- %keybind , ((modMask x .|. 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'
|