module XMonad.Actions.WithAll (
sinkAll, withAll,
withAll', killAll,
killOthers) where
import XMonad.Prelude hiding (foldr)
import XMonad
import XMonad.StackSet
sinkAll :: X ()
sinkAll :: X ()
sinkAll = (Window -> WindowSet -> WindowSet) -> X ()
withAll' forall a i l s sd.
Ord a =>
a -> StackSet i l a s sd -> StackSet i l a s sd
sink
withAll' :: (Window -> WindowSet -> WindowSet) -> X ()
withAll' :: (Window -> WindowSet -> WindowSet) -> X ()
withAll' Window -> WindowSet -> WindowSet
f = (WindowSet -> WindowSet) -> X ()
windows forall a b. (a -> b) -> a -> b
$ \WindowSet
ws -> let all' :: [Window]
all' = forall a. Maybe (Stack a) -> [a]
integrate' forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i l a. Workspace i l a -> Maybe (Stack a)
stack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
workspace forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
current forall a b. (a -> b) -> a -> b
$ WindowSet
ws
in forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr Window -> WindowSet -> WindowSet
f WindowSet
ws [Window]
all'
withAll :: (Window -> X ()) -> X()
withAll :: (Window -> X ()) -> X ()
withAll Window -> X ()
f = forall a. (WindowSet -> X a) -> X a
withWindowSet forall a b. (a -> b) -> a -> b
$ \WindowSet
ws -> let all' :: [Window]
all' = forall a. Maybe (Stack a) -> [a]
integrate' forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i l a. Workspace i l a -> Maybe (Stack a)
stack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
workspace forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
current forall a b. (a -> b) -> a -> b
$ WindowSet
ws
in forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
t a -> (a -> m b) -> m ()
forM_ [Window]
all' Window -> X ()
f
killAll :: X()
killAll :: X ()
killAll = (Window -> X ()) -> X ()
withAll Window -> X ()
killWindow
killOthers :: X ()
killOthers :: X ()
killOthers = (Window -> X ()) -> X ()
withUnfocused Window -> X ()
killWindow