Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- focusByClass :: String -> X()
- focusByClass n = do
- ws <- gets $ W.index . windowset
- app <- findByQuery ws (className =? n)
- whenJust app focus
- findByQuery :: [Window] -> Query Bool -> X (Maybe Window)
- findByQuery ws q = do
- w <- filterM (runQuery q) ws
- case (length w > 0) of
- True -> return $ Just $ head w
- False -> return Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement