diff options
Diffstat (limited to 'src/Internal/Windows.hs')
| -rw-r--r-- | src/Internal/Windows.hs | 6 |
1 files changed, 5 insertions, 1 deletions
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. - |