#!/usr/bin/python3

import pyatspi

def listener(e):
    if not e.detail1:
        return

    print(e.source)

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