mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
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.
This commit is contained in:
parent
ebd38ec6b8
commit
f94ab30506
34
SinkAll.hs
Normal file
34
SinkAll.hs
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user