variable scope between themes and plugins

Hi guys,

I have a custom theme that I've written as a basic platform that gets the site looking 80% correct, and then for several reasons I'm using a plugin to add custom CSS and JS to take it the rest of the way to the final appearance. This approach is really helpful if, like me, you want several sites to be driven off of mostly-common code, but the the flexibility to tweak it for each site.

The problem is that I want to make sure that my plugin only works with my theme, and no other theme. "Eeasy," I thought, "I'll just declare a global variable in my template's functions.php file, and then check for it in the plugin."

No dice.

I must have tried a hundred-and-one approaches to this, and for the life of me can't get a plugin to recognize anything from a template or vise-verse. No functions, no globals, nothing. I even tried using wp_register and add_action hooks of various kinds to try to register the variable through WP, and nothing seems to work.

Could somebody smarter than me drop a hint before I stab out my eyes?

Many thanks,
Adam