The action load-themes.php is triggered when the theme option page is shown. It executes only when the theme that contains the action (in function.php) is selected.
You can use it to execute something when your theme is activated or deactivated.
<?php add_action('load-themes.php', $function_to_add); ?>
function init_theme() { if ( isset( $_GET['activated'] ) ) { // Test if theme is activated // What to do when theme is active } } add_action( 'load-themes.php', 'init_theme' );