My approach is described here:
http://www.jayconrod.com/cgi/view_post.py?23
However, this is probably not useful for your problem, it's better suited to change the way nickel interacts with the kernel or other programs. I have not looked into it yet, but "ah-" seems to have gained some access to the nickel internas with his KoboTweaks plugin.