Simplify utility window query
This commit is contained in:
parent
064352bdda
commit
5af4daccc8
1 changed files with 1 additions and 13 deletions
14
xmonad.hs
14
xmonad.hs
|
@ -86,20 +86,8 @@ myStartupHook = do
|
||||||
setWMName "LG3D"
|
setWMName "LG3D"
|
||||||
|
|
||||||
|
|
||||||
atomProperty :: String -> Query Atom
|
|
||||||
atomProperty p = ask >>= (\w -> liftX $ withDisplay $ \d -> fmap (fromMaybe 0) $ getAtomProperty d w p)
|
|
||||||
|
|
||||||
getAtomProperty :: Display -> Window -> String -> X (Maybe Atom)
|
|
||||||
getAtomProperty d w p = do
|
|
||||||
a <- getAtom p
|
|
||||||
md <- io $ getWindowProperty32 d a w
|
|
||||||
return $ fmap fromIntegral $ listToMaybe $ fromMaybe [] md
|
|
||||||
|
|
||||||
isUtility :: Query Bool
|
isUtility :: Query Bool
|
||||||
isUtility = do
|
isUtility = isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_UTILITY"
|
||||||
atom__NET_WM_WINDOW_TYPE_UTILITY <- liftX $ getAtom "_NET_WM_WINDOW_TYPE_UTILITY"
|
|
||||||
atomProperty "_NET_WM_WINDOW_TYPE" =? atom__NET_WM_WINDOW_TYPE_UTILITY
|
|
||||||
|
|
||||||
|
|
||||||
myManageHook :: ManageHook
|
myManageHook :: ManageHook
|
||||||
myManageHook = composeAll
|
myManageHook = composeAll
|
||||||
|
|
Reference in a new issue