You are not logged in.
Hi everyone, I think this should be really easy for someone who's good at Haskell but I just couldn't figure it out as I'm bad at it.
Basically I want to search through the list of windows in the current workspace, find one matching some condition and apply some action to it; if not found then create this window.
I had a skeleton code like this
import qualified XMonad.StackSet as W
import XMonad.Actions.WindowGo
findWindow condition actionIfFound actionIfNotFound =
ifWindow (condition <&&> member W.current) windowFound actionIfNotFound
where windowFound = ask >>= w -> do actionIfFound wOffline