diff options
| author | Josh Rahm <rahm@google.com> | 2022-03-28 11:52:34 -0600 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2022-03-28 11:52:34 -0600 |
| commit | d15ea771e45b60f32c83bfd90386c60d192299c0 (patch) | |
| tree | b9621342d9f16d25ce9ae2fdc1929934e4f8931e /src/Internal/Windows.hs | |
| parent | b8bb40af61fbbf1c13c4556832055304109311db (diff) | |
| download | rde-d15ea771e45b60f32c83bfd90386c60d192299c0.tar.gz rde-d15ea771e45b60f32c83bfd90386c60d192299c0.tar.bz2 rde-d15ea771e45b60f32c83bfd90386c60d192299c0.zip | |
Add (some) ability to send keys to other windows
Diffstat (limited to 'src/Internal/Windows.hs')
| -rw-r--r-- | src/Internal/Windows.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Internal/Windows.hs b/src/Internal/Windows.hs index b6f5335..c6a2b8b 100644 --- a/src/Internal/Windows.hs +++ b/src/Internal/Windows.hs @@ -1,7 +1,9 @@ module Internal.Windows where +import XMonad (windowset, X, Window, get) + import Control.Applicative ((<|>)) -import XMonad.StackSet (Stack(..), StackSet(..), Screen(..), Workspace(..), integrate, integrate') +import XMonad.StackSet (Stack(..), StackSet(..), Screen(..), Workspace(..), integrate, integrate', allWindows) import Data.Maybe (listToMaybe, catMaybes) import qualified Data.Map as Map @@ -45,6 +47,11 @@ getLocationWorkspace _ = Nothing workspaceMember :: (Eq a) => Workspace i l a -> a -> Bool workspaceMember (Workspace _ _ s) w = w `elem` integrate' s +forAllWindows :: (Window -> X ()) -> X () +forAllWindows fn = do + stackSet <- windowset <$> get + mapM_ fn (allWindows stackSet) + {- Finds a Window and returns the screen its on and the workspace its on. - Returns nothing if the window doesn't exist. - |