diff options
author | Spencer Janssen <spencerjanssen@gmail.com> | 2009-01-17 05:04:32 +0100 |
---|---|---|
committer | Spencer Janssen <spencerjanssen@gmail.com> | 2009-01-17 05:04:32 +0100 |
commit | 90949577aeb040012a49c7687bcfec8fcfb80e34 (patch) | |
tree | ac6147d375cb6fda28e135cee521cf9597791f65 /XMonad/Hooks | |
parent | 8c294bb7ac6c1c6a71edfeae11719111a84bf284 (diff) | |
download | XMonadContrib-90949577aeb040012a49c7687bcfec8fcfb80e34.tar.gz XMonadContrib-90949577aeb040012a49c7687bcfec8fcfb80e34.tar.xz XMonadContrib-90949577aeb040012a49c7687bcfec8fcfb80e34.zip |
Add XMonad.Actions.SpawnOn
Ignore-this: 63869d1ab11f2ed5aab1690763065800
darcs-hash:20090117040432-25a6b-306aa18fed69a47197ca8c349cf6452939db5188.gz
Diffstat (limited to 'XMonad/Hooks')
-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'. |