I think you can use the plugin API to do it:
You can find more info here: Change icons globally using the APIs