diff options
Diffstat (limited to '')
-rw-r--r-- | XMonad/Hooks/ManageHelpers.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/XMonad/Hooks/ManageHelpers.hs b/XMonad/Hooks/ManageHelpers.hs index 5dd8e32..e5f25e4 100644 --- a/XMonad/Hooks/ManageHelpers.hs +++ b/XMonad/Hooks/ManageHelpers.hs @@ -31,6 +31,7 @@ module XMonad.Hooks.ManageHelpers ( isKDETrayWindow, isFullscreen, isDialog, + pid, transientTo, maybeToDefinite, MaybeManageHook, @@ -49,6 +50,8 @@ import qualified XMonad.StackSet as W import Data.Maybe import Data.Monoid +import System.Posix (ProcessID) + -- | Denotes a side of a screen. @S@ stands for South, @NE@ for Northwest -- etc. @C@ stands for Center. data Side = SC | NC | CE | CW | SE | SW | NE | NW | C @@ -144,6 +147,15 @@ isDialog = ask >>= \w -> liftX $ do Just xs -> fromIntegral w_dialog `elem` xs _ -> False +pid :: Query (Maybe ProcessID) +pid = ask >>= \w -> liftX $ do + dpy <- asks display + a <- getAtom "_NET_WM_PID" + p <- io $ getWindowProperty32 dpy a w + return $ case p of + Just [x] -> Just (fromIntegral x) + _ -> Nothing + -- | A predicate to check whether a window is Transient. -- It holds the result which might be the window it is transient to -- or it might be 'Nothing'. |