#!/usr/bin/python

import pyatspi

def listener(e):
    try:
        role = e.source.getRole()
        appName = e.host_application.name
    except RuntimeError:
        role = None
        appName = ''
    if appName != 'gnome-control-center' or role != pyatspi.ROLE_PUSH_BUTTON:
	return

    print e.type, e.source

pyatspi.Registry.registerEventListener(
    listener, 'object:state-changed', 'object:property-change')
pyatspi.Registry.start()

