#!/usr/bin/python3

import pyatspi
import time


def listener(e):
    try:
        if e.host_application.name != "gnome-shell":
            return
    except:
        return

    print(time.strftime("%H:%M:%S", time.localtime()), e.source, e.type, bool(e.detail1))

pyatspi.Registry.registerEventListener(listener, "object:state-changed:showing")
pyatspi.Registry.start()
