void handle_theme(char * theme_name) {
    char full_theme_file[1000];
    char * theme_base;
    char * theme_end;

    theme_base = "/res/theme/theme_";
    theme_end = ".ini";
    strcpy(full_theme_file, theme_base);
    strcat(full_theme_file, theme_name);
    strcat(full_theme_file, theme_end);
    theme themeconfig;

    if (ini_parse(full_theme_file, theme_handler, &themeconfig) < 0) {
        LOGI("Can't load theme!\n");
        return 1;
    }
    LOGI("Theme loaded!\n");

    UICOLOR0 = themeconfig.uicolor0;
    UICOLOR1 = themeconfig.uicolor1;
    UICOLOR2 = themeconfig.uicolor2;
	if (UITHEME != EASTEREGG)
		UITHEME = themeconfig.bgicon;

    ui_dyn_background();
    ui_reset_icons();
}
void handle_theme(char * theme_name) {
	char full_theme_file[1000];
	char * theme_base;
	char * theme_end;

	switch(is_sd_theme) {
		case 0:
			theme_base = "/res/theme/";
			theme_end = "/theme.ini";
			break;
		case 1:
			theme_base = "/sdcard/0/cotrecovery/theme/";
			theme_end = "/theme.ini";
			break;
		default:
			theme_base = "/res/theme/";
			theme_end = "/theme.ini";
			break;
	}
	strcpy(full_theme_file, theme_base);
	strcat(full_theme_file, theme_name);
	strcat(full_theme_file, theme_end);
	theme themeconfig;

	if (ini_parse(full_theme_file, theme_handler, &themeconfig) < 0) {
		LOGI("Can't load theme!\n");
		return 1;
	}
	LOGI("Theme loaded!\n");

	UICOLOR0 = themeconfig.uicolor0;
	UICOLOR1 = themeconfig.uicolor1;
	UICOLOR2 = themeconfig.uicolor2;
	themename = themeconfig.name;
	printf("I:Loading %s resources...\n", themename);

	ui_reset_icons();
	ui_set_background(BACKGROUND_ICON_CLOCKWORK);
}