Periodically store the active x11 window and send a notification when rules are matched.