{-# LANGUAGE LambdaCase #-}
module XMonad.Util.ExclusiveScratchpads
{-# DEPRECATED "Use the exclusive scratchpad functionality of \"XMonad.Util.NamedScratchpad\" insead." #-}
(
mkXScratchpads,
xScratchpadsManageHook,
scratchpadAction,
hideAll,
resetExclusiveSp,
setNoexclusive,
resizeNoexclusive,
floatMoveNoexclusive,
ExclusiveScratchpad(..),
ExclusiveScratchpads,
nonFloating,
defaultFloating,
customFloating
) where
import XMonad.Prelude
import XMonad
import XMonad.Actions.Minimize
import XMonad.Actions.TagWindows (addTag,delTag)
import XMonad.Hooks.ManageHelpers (doRectFloat,isInProperty)
import qualified XMonad.StackSet as W
import qualified Data.List.NonEmpty as NE
data ExclusiveScratchpad = XSP { ExclusiveScratchpad -> [Char]
name :: String
, ExclusiveScratchpad -> [Char]
cmd :: String
, ExclusiveScratchpad -> Query Bool
query :: Query Bool
, ExclusiveScratchpad -> Query (Endo WindowSet)
hook :: ManageHook
, ExclusiveScratchpad -> [[Char]]
exclusive :: [String]
}
type ExclusiveScratchpads = [ExclusiveScratchpad]
mkXScratchpads :: [(String,String,Query Bool)]
-> ManageHook
-> ExclusiveScratchpads
mkXScratchpads :: [([Char], [Char], Query Bool)]
-> Query (Endo WindowSet) -> ExclusiveScratchpads
mkXScratchpads [([Char], [Char], Query Bool)]
xs Query (Endo WindowSet)
h = (ExclusiveScratchpads
-> ([Char], [Char], Query Bool) -> ExclusiveScratchpads)
-> ExclusiveScratchpads
-> [([Char], [Char], Query Bool)]
-> ExclusiveScratchpads
forall b a. (b -> a -> b) -> b -> [a] -> b
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl ExclusiveScratchpads
-> ([Char], [Char], Query Bool) -> ExclusiveScratchpads
accumulate [] [([Char], [Char], Query Bool)]
xs
where
accumulate :: ExclusiveScratchpads
-> ([Char], [Char], Query Bool) -> ExclusiveScratchpads
accumulate ExclusiveScratchpads
a ([Char]
n,[Char]
c,Query Bool
q) = [Char]
-> [Char]
-> Query Bool
-> Query (Endo WindowSet)
-> [[Char]]
-> ExclusiveScratchpad
XSP [Char]
n [Char]
c Query Bool
q Query (Endo WindowSet)
h (([Char] -> Bool) -> [[Char]] -> [[Char]]
forall a. (a -> Bool) -> [a] -> [a]
filter ([Char]
n[Char] -> [Char] -> Bool
forall a. Eq a => a -> a -> Bool
/=) [[Char]]
names) ExclusiveScratchpad -> ExclusiveScratchpads -> ExclusiveScratchpads
forall a. a -> [a] -> [a]
: ExclusiveScratchpads
a
names :: [[Char]]
names = (([Char], [Char], Query Bool) -> [Char])
-> [([Char], [Char], Query Bool)] -> [[Char]]
forall a b. (a -> b) -> [a] -> [b]
map (\([Char]
n,[Char]
_,Query Bool
_) -> [Char]
n) [([Char], [Char], Query Bool)]
xs
xScratchpadsManageHook :: ExclusiveScratchpads
-> ManageHook
xScratchpadsManageHook :: ExclusiveScratchpads -> Query (Endo WindowSet)
xScratchpadsManageHook = [Query (Endo WindowSet)] -> Query (Endo WindowSet)
forall m. Monoid m => [m] -> m
composeAll ([Query (Endo WindowSet)] -> Query (Endo WindowSet))
-> (ExclusiveScratchpads -> [Query (Endo WindowSet)])
-> ExclusiveScratchpads
-> Query (Endo WindowSet)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ExclusiveScratchpad -> Query (Endo WindowSet))
-> ExclusiveScratchpads -> [Query (Endo WindowSet)]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\ExclusiveScratchpad
sp -> ExclusiveScratchpad -> Query Bool
query ExclusiveScratchpad
sp Query Bool -> Query (Endo WindowSet) -> Query (Endo WindowSet)
forall (m :: * -> *) a. (Monad m, Monoid a) => m Bool -> m a -> m a
--> ExclusiveScratchpad -> Query (Endo WindowSet)
hook ExclusiveScratchpad
sp)
scratchpadAction :: ExclusiveScratchpads
-> String
-> X ()
scratchpadAction :: ExclusiveScratchpads -> [Char] -> X ()
scratchpadAction ExclusiveScratchpads
xs [Char]
n =
let ys :: ExclusiveScratchpads
ys = (ExclusiveScratchpad -> Bool)
-> ExclusiveScratchpads -> ExclusiveScratchpads
forall a. (a -> Bool) -> [a] -> [a]
filter (([Char]
n[Char] -> [Char] -> Bool
forall a. Eq a => a -> a -> Bool
==)([Char] -> Bool)
-> (ExclusiveScratchpad -> [Char]) -> ExclusiveScratchpad -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
.ExclusiveScratchpad -> [Char]
name) ExclusiveScratchpads
xs in
case ExclusiveScratchpads
ys of [] -> () -> X ()
forall a. a -> X a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
(ExclusiveScratchpad
sp:ExclusiveScratchpads
_) -> let q :: Query Bool
q = ExclusiveScratchpad -> Query Bool
query ExclusiveScratchpad
sp in (WindowSet -> X ()) -> X ()
forall a. (WindowSet -> X a) -> X a
withWindowSet ((WindowSet -> X ()) -> X ()) -> (WindowSet -> X ()) -> X ()
forall a b. (a -> b) -> a -> b
$ \WindowSet
s -> do
ws <- (Word64 -> X Bool) -> [Word64] -> X [Word64]
forall (m :: * -> *) a.
Applicative m =>
(a -> m Bool) -> [a] -> m [a]
filterM (Query Bool -> Word64 -> X Bool
forall a. Query a -> Word64 -> X a
runQuery Query Bool
q) ([Word64] -> X [Word64]) -> [Word64] -> X [Word64]
forall a b. (a -> b) -> a -> b
$ WindowSet -> [Word64]
forall a i l s sd. Eq a => StackSet i l a s sd -> [a]
W.allWindows WindowSet
s
case ws of [] -> do [Char] -> X ()
forall (m :: * -> *). MonadIO m => [Char] -> m ()
spawn (ExclusiveScratchpad -> [Char]
cmd ExclusiveScratchpad
sp)
ExclusiveScratchpads -> [Char] -> X ()
hideOthers ExclusiveScratchpads
xs [Char]
n
(WindowSet -> WindowSet) -> X ()
windows WindowSet -> WindowSet
forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
W.shiftMaster
(Word64
w:[Word64]
_) -> do Word64 -> X ()
toggleWindow Word64
w
X Bool -> X () -> X ()
whenX (Query Bool -> Word64 -> X Bool
forall a. Query a -> Word64 -> X a
runQuery Query Bool
isExclusive Word64
w) (ExclusiveScratchpads -> [Char] -> X ()
hideOthers ExclusiveScratchpads
xs [Char]
n)
where
toggleWindow :: Word64 -> X ()
toggleWindow Word64
w = (Bool -> Bool -> Bool) -> X Bool -> X Bool -> X Bool
forall a b c. (a -> b -> c) -> X a -> X b -> X c
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 Bool -> Bool -> Bool
(&&) (Query Bool -> Word64 -> X Bool
forall a. Query a -> Word64 -> X a
runQuery Query Bool
isMaximized Word64
w) (Word64 -> X Bool
onCurrentScreen Word64
w) X Bool -> (Bool -> X ()) -> X ()
forall a b. X a -> (a -> X b) -> X b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
Bool
True -> X Bool -> X () -> X ()
whenX (Word64 -> X Bool
onCurrentScreen Word64
w) (Word64 -> X ()
minimizeWindow Word64
w)
Bool
False -> do (WindowSet -> WindowSet) -> X ()
windows (([Char] -> Word64 -> WindowSet -> WindowSet)
-> Word64 -> [Char] -> WindowSet -> WindowSet
forall a b c. (a -> b -> c) -> b -> a -> c
flip [Char] -> Word64 -> WindowSet -> WindowSet
forall a s i l sd.
(Ord a, Eq s, Eq i) =>
i -> a -> StackSet i l a s sd -> StackSet i l a s sd
W.shiftWin Word64
w ([Char] -> WindowSet -> WindowSet)
-> (WindowSet -> [Char]) -> WindowSet -> WindowSet
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< WindowSet -> [Char]
forall i l a s sd. StackSet i l a s sd -> i
W.currentTag)
Word64 -> X ()
maximizeWindowAndFocus Word64
w
(WindowSet -> WindowSet) -> X ()
windows WindowSet -> WindowSet
forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
W.shiftMaster
onCurrentScreen :: Word64 -> X Bool
onCurrentScreen Word64
w = (WindowSet -> X Bool) -> X Bool
forall a. (WindowSet -> X a) -> X a
withWindowSet (Bool -> X Bool
forall a. a -> X a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool -> X Bool) -> (WindowSet -> Bool) -> WindowSet -> X Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word64 -> [Word64] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
elem Word64
w ([Word64] -> Bool) -> (WindowSet -> [Word64]) -> WindowSet -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WindowSet -> [Word64]
forall i l a sid sd. StackSet i l a sid sd -> [a]
currentWindows)
hideAll :: ExclusiveScratchpads
-> X ()
hideAll :: ExclusiveScratchpads -> X ()
hideAll ExclusiveScratchpads
xs = Query Bool -> (Word64 -> X ()) -> X ()
mapWithCurrentScreen Query Bool
q Word64 -> X ()
minimizeWindow
where q :: Query Bool
q = [Query Bool] -> Query Bool
joinQueries ((ExclusiveScratchpad -> Query Bool)
-> ExclusiveScratchpads -> [Query Bool]
forall a b. (a -> b) -> [a] -> [b]
map ExclusiveScratchpad -> Query Bool
query ExclusiveScratchpads
xs) Query Bool -> Query Bool -> Query Bool
forall (m :: * -> *). Monad m => m Bool -> m Bool -> m Bool
<&&> Query Bool
isExclusive Query Bool -> Query Bool -> Query Bool
forall (m :: * -> *). Monad m => m Bool -> m Bool -> m Bool
<&&> Query Bool
isMaximized
resetExclusiveSp :: ExclusiveScratchpads
-> X ()
resetExclusiveSp :: ExclusiveScratchpads -> X ()
resetExclusiveSp ExclusiveScratchpads
xs = (Word64 -> X ()) -> X ()
withFocused ((Word64 -> X ()) -> X ()) -> (Word64 -> X ()) -> X ()
forall a b. (a -> b) -> a -> b
$ \Word64
w -> X Bool -> X () -> X ()
whenX (ExclusiveScratchpads -> Word64 -> X Bool
isScratchpad ExclusiveScratchpads
xs Word64
w) (X () -> X ()) -> X () -> X ()
forall a b. (a -> b) -> a -> b
$ do
let ys :: X ExclusiveScratchpads
ys = (ExclusiveScratchpad -> X Bool)
-> ExclusiveScratchpads -> X ExclusiveScratchpads
forall (m :: * -> *) a.
Applicative m =>
(a -> m Bool) -> [a] -> m [a]
filterM ((Query Bool -> Word64 -> X Bool) -> Word64 -> Query Bool -> X Bool
forall a b c. (a -> b -> c) -> b -> a -> c
flip Query Bool -> Word64 -> X Bool
forall a. Query a -> Word64 -> X a
runQuery Word64
w (Query Bool -> X Bool)
-> (ExclusiveScratchpad -> Query Bool)
-> ExclusiveScratchpad
-> X Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ExclusiveScratchpad -> Query Bool
query) ExclusiveScratchpads
xs
X Bool -> X () -> X ()
unlessX (ExclusiveScratchpads -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null (ExclusiveScratchpads -> Bool) -> X ExclusiveScratchpads -> X Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> X ExclusiveScratchpads
ys) (X () -> X ()) -> X () -> X ()
forall a b. (a -> b) -> a -> b
$ do
mh <- NonEmpty (Query (Endo WindowSet)) -> Query (Endo WindowSet)
forall a. NonEmpty a -> a
NE.head (NonEmpty (Query (Endo WindowSet)) -> Query (Endo WindowSet))
-> (ExclusiveScratchpads -> NonEmpty (Query (Endo WindowSet)))
-> ExclusiveScratchpads
-> Query (Endo WindowSet)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Query (Endo WindowSet)] -> NonEmpty (Query (Endo WindowSet))
forall a. HasCallStack => [a] -> NonEmpty a
notEmpty ([Query (Endo WindowSet)] -> NonEmpty (Query (Endo WindowSet)))
-> (ExclusiveScratchpads -> [Query (Endo WindowSet)])
-> ExclusiveScratchpads
-> NonEmpty (Query (Endo WindowSet))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ExclusiveScratchpad -> Query (Endo WindowSet))
-> ExclusiveScratchpads -> [Query (Endo WindowSet)]
forall a b. (a -> b) -> [a] -> [b]
map ExclusiveScratchpad -> Query (Endo WindowSet)
hook (ExclusiveScratchpads -> Query (Endo WindowSet))
-> X ExclusiveScratchpads -> X (Query (Endo WindowSet))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> X ExclusiveScratchpads
ys
n <- NE.head . notEmpty . map name <$> ys
(windows . appEndo <=< runQuery mh) w
hideOthers xs n
delTag "_XSP_NOEXCLUSIVE" w
where unlessX :: X Bool -> X () -> X ()
unlessX = X Bool -> X () -> X ()
whenX (X Bool -> X () -> X ())
-> (X Bool -> X Bool) -> X Bool -> X () -> X ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> Bool) -> X Bool -> X Bool
forall a b. (a -> b) -> X a -> X b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> Bool
not
hideOthers :: ExclusiveScratchpads -> String -> X ()
hideOthers :: ExclusiveScratchpads -> [Char] -> X ()
hideOthers ExclusiveScratchpads
xs [Char]
n =
let ys :: [[Char]]
ys = (ExclusiveScratchpad -> [[Char]])
-> ExclusiveScratchpads -> [[Char]]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap ExclusiveScratchpad -> [[Char]]
exclusive (ExclusiveScratchpads -> [[Char]])
-> ExclusiveScratchpads -> [[Char]]
forall a b. (a -> b) -> a -> b
$ (ExclusiveScratchpad -> Bool)
-> ExclusiveScratchpads -> ExclusiveScratchpads
forall a. (a -> Bool) -> [a] -> [a]
filter (([Char]
n[Char] -> [Char] -> Bool
forall a. Eq a => a -> a -> Bool
==)([Char] -> Bool)
-> (ExclusiveScratchpad -> [Char]) -> ExclusiveScratchpad -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
.ExclusiveScratchpad -> [Char]
name) ExclusiveScratchpads
xs
qs :: [Query Bool]
qs = (ExclusiveScratchpad -> Query Bool)
-> ExclusiveScratchpads -> [Query Bool]
forall a b. (a -> b) -> [a] -> [b]
map ExclusiveScratchpad -> Query Bool
query (ExclusiveScratchpads -> [Query Bool])
-> ExclusiveScratchpads -> [Query Bool]
forall a b. (a -> b) -> a -> b
$ (ExclusiveScratchpad -> Bool)
-> ExclusiveScratchpads -> ExclusiveScratchpads
forall a. (a -> Bool) -> [a] -> [a]
filter (([Char] -> [[Char]] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [[Char]]
ys)([Char] -> Bool)
-> (ExclusiveScratchpad -> [Char]) -> ExclusiveScratchpad -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
.ExclusiveScratchpad -> [Char]
name) ExclusiveScratchpads
xs
q :: Query Bool
q = [Query Bool] -> Query Bool
joinQueries [Query Bool]
qs Query Bool -> Query Bool -> Query Bool
forall (m :: * -> *). Monad m => m Bool -> m Bool -> m Bool
<&&> Query Bool
isExclusive Query Bool -> Query Bool -> Query Bool
forall (m :: * -> *). Monad m => m Bool -> m Bool -> m Bool
<&&> Query Bool
isMaximized in
Query Bool -> (Word64 -> X ()) -> X ()
mapWithCurrentScreen Query Bool
q Word64 -> X ()
minimizeWindow
mapWithCurrentScreen :: Query Bool -> (Window -> X ()) -> X ()
mapWithCurrentScreen :: Query Bool -> (Word64 -> X ()) -> X ()
mapWithCurrentScreen Query Bool
q Word64 -> X ()
f = (WindowSet -> X ()) -> X ()
forall a. (WindowSet -> X a) -> X a
withWindowSet ((WindowSet -> X ()) -> X ()) -> (WindowSet -> X ()) -> X ()
forall a b. (a -> b) -> a -> b
$ \WindowSet
s -> do
ws <- (Word64 -> X Bool) -> [Word64] -> X [Word64]
forall (m :: * -> *) a.
Applicative m =>
(a -> m Bool) -> [a] -> m [a]
filterM (Query Bool -> Word64 -> X Bool
forall a. Query a -> Word64 -> X a
runQuery Query Bool
q) ([Word64] -> X [Word64]) -> [Word64] -> X [Word64]
forall a b. (a -> b) -> a -> b
$ WindowSet -> [Word64]
forall i l a sid sd. StackSet i l a sid sd -> [a]
currentWindows WindowSet
s
mapM_ f ws
currentWindows :: W.StackSet i l a sid sd -> [a]
currentWindows :: forall i l a sid sd. StackSet i l a sid sd -> [a]
currentWindows = Maybe (Stack a) -> [a]
forall a. Maybe (Stack a) -> [a]
W.integrate' (Maybe (Stack a) -> [a])
-> (StackSet i l a sid sd -> Maybe (Stack a))
-> StackSet i l a sid sd
-> [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Workspace i l a -> Maybe (Stack a)
forall i l a. Workspace i l a -> Maybe (Stack a)
W.stack (Workspace i l a -> Maybe (Stack a))
-> (StackSet i l a sid sd -> Workspace i l a)
-> StackSet i l a sid sd
-> Maybe (Stack a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Screen i l a sid sd -> Workspace i l a
forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
W.workspace (Screen i l a sid sd -> Workspace i l a)
-> (StackSet i l a sid sd -> Screen i l a sid sd)
-> StackSet i l a sid sd
-> Workspace i l a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StackSet i l a sid sd -> Screen i l a sid sd
forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
W.current
isScratchpad :: ExclusiveScratchpads -> Window -> X Bool
isScratchpad :: ExclusiveScratchpads -> Word64 -> X Bool
isScratchpad ExclusiveScratchpads
xs Word64
w = (WindowSet -> X Bool) -> X Bool
forall a. (WindowSet -> X a) -> X a
withWindowSet ((WindowSet -> X Bool) -> X Bool)
-> (WindowSet -> X Bool) -> X Bool
forall a b. (a -> b) -> a -> b
$ \WindowSet
s -> do
let q :: Query Bool
q = [Query Bool] -> Query Bool
joinQueries ([Query Bool] -> Query Bool) -> [Query Bool] -> Query Bool
forall a b. (a -> b) -> a -> b
$ (ExclusiveScratchpad -> Query Bool)
-> ExclusiveScratchpads -> [Query Bool]
forall a b. (a -> b) -> [a] -> [b]
map ExclusiveScratchpad -> Query Bool
query ExclusiveScratchpads
xs
ws <- (Word64 -> X Bool) -> [Word64] -> X [Word64]
forall (m :: * -> *) a.
Applicative m =>
(a -> m Bool) -> [a] -> m [a]
filterM (Query Bool -> Word64 -> X Bool
forall a. Query a -> Word64 -> X a
runQuery Query Bool
q) ([Word64] -> X [Word64]) -> [Word64] -> X [Word64]
forall a b. (a -> b) -> a -> b
$ WindowSet -> [Word64]
forall a i l s sd. Eq a => StackSet i l a s sd -> [a]
W.allWindows WindowSet
s
return $ elem w ws
joinQueries :: [Query Bool] -> Query Bool
joinQueries :: [Query Bool] -> Query Bool
joinQueries = (Query Bool -> Query Bool -> Query Bool)
-> Query Bool -> [Query Bool] -> Query Bool
forall b a. (b -> a -> b) -> b -> [a] -> b
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl Query Bool -> Query Bool -> Query Bool
forall (m :: * -> *). Monad m => m Bool -> m Bool -> m Bool
(<||>) (X Bool -> Query Bool
forall a. X a -> Query a
liftX (X Bool -> Query Bool) -> X Bool -> Query Bool
forall a b. (a -> b) -> a -> b
$ Bool -> X Bool
forall a. a -> X a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
False)
isExclusive, isMaximized :: Query Bool
isExclusive :: Query Bool
isExclusive = [Char] -> [[Char]] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
notElem [Char]
"_XSP_NOEXCLUSIVE" ([[Char]] -> Bool) -> ([Char] -> [[Char]]) -> [Char] -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Char] -> [[Char]]
words ([Char] -> Bool) -> Query [Char] -> Query Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Char] -> Query [Char]
stringProperty [Char]
"_XMONAD_TAGS"
isMaximized :: Query Bool
isMaximized = Bool -> Bool
not (Bool -> Bool) -> Query Bool -> Query Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Char] -> [Char] -> Query Bool
isInProperty [Char]
"_NET_WM_STATE" [Char]
"_NET_WM_STATE_HIDDEN"
setNoexclusive :: ExclusiveScratchpads
-> Window
-> X ()
setNoexclusive :: ExclusiveScratchpads -> Word64 -> X ()
setNoexclusive ExclusiveScratchpads
xs Word64
w = X Bool -> X () -> X ()
whenX (ExclusiveScratchpads -> Word64 -> X Bool
isScratchpad ExclusiveScratchpads
xs Word64
w) (X () -> X ()) -> X () -> X ()
forall a b. (a -> b) -> a -> b
$ [Char] -> Word64 -> X ()
addTag [Char]
"_XSP_NOEXCLUSIVE" Word64
w
floatMoveNoexclusive :: ExclusiveScratchpads
-> Window
-> X ()
floatMoveNoexclusive :: ExclusiveScratchpads -> Word64 -> X ()
floatMoveNoexclusive ExclusiveScratchpads
xs Word64
w = ExclusiveScratchpads -> Word64 -> X ()
setNoexclusive ExclusiveScratchpads
xs Word64
w
X () -> X () -> X ()
forall a b. X a -> X b -> X b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Word64 -> X ()
focus Word64
w
X () -> X () -> X ()
forall a b. X a -> X b -> X b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Word64 -> X ()
mouseMoveWindow Word64
w
X () -> X () -> X ()
forall a b. X a -> X b -> X b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> (WindowSet -> WindowSet) -> X ()
windows WindowSet -> WindowSet
forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
W.shiftMaster
resizeNoexclusive :: ExclusiveScratchpads
-> Window
-> X ()
resizeNoexclusive :: ExclusiveScratchpads -> Word64 -> X ()
resizeNoexclusive ExclusiveScratchpads
xs Word64
w = ExclusiveScratchpads -> Word64 -> X ()
setNoexclusive ExclusiveScratchpads
xs Word64
w
X () -> X () -> X ()
forall a b. X a -> X b -> X b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Word64 -> X ()
focus Word64
w
X () -> X () -> X ()
forall a b. X a -> X b -> X b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Word64 -> X ()
mouseResizeWindow Word64
w
X () -> X () -> X ()
forall a b. X a -> X b -> X b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> (WindowSet -> WindowSet) -> X ()
windows WindowSet -> WindowSet
forall i l a s sd. StackSet i l a s sd -> StackSet i l a s sd
W.shiftMaster
nonFloating :: ManageHook
nonFloating :: Query (Endo WindowSet)
nonFloating = Query (Endo WindowSet)
forall m. Monoid m => m
idHook
defaultFloating :: ManageHook
defaultFloating :: Query (Endo WindowSet)
defaultFloating = Query (Endo WindowSet)
doFloat
customFloating :: W.RationalRect
-> ManageHook
customFloating :: RationalRect -> Query (Endo WindowSet)
customFloating = RationalRect -> Query (Endo WindowSet)
doRectFloat