From 3f6b3dd99cd45fdd063580fa1deb03257c65e83e Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sat, 9 Apr 2022 15:09:55 -0600 Subject: Change mosaic to respond to multiple different kinds of messages --- src/Internal/Windows.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Internal/Windows.hs') diff --git a/src/Internal/Windows.hs b/src/Internal/Windows.hs index 98baa51..45fea95 100644 --- a/src/Internal/Windows.hs +++ b/src/Internal/Windows.hs @@ -3,7 +3,7 @@ module Internal.Windows where import XMonad (windowset, X, Window, get) import Control.Applicative ((<|>)) -import XMonad.StackSet (Stack(..), StackSet(..), Screen(..), Workspace(..), integrate, integrate', allWindows) +import XMonad.StackSet (Stack(..), StackSet(..), Screen(..), Workspace(..), peek, integrate, integrate', allWindows) import Data.Maybe (listToMaybe, catMaybes) import qualified Data.Map as Map @@ -52,6 +52,10 @@ forAllWindows fn = do stackSet <- windowset <$> get mapM_ fn (allWindows stackSet) +getFocusedWindow :: X (Maybe Window) +getFocusedWindow = do + (peek . windowset) <$> get + {- Finds a Window and returns the screen its on and the workspace its on. - Returns nothing if the window doesn't exist. - -- cgit