summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/ipc.c2
-rw-r--r--src/bin/ipc.h1
-rw-r--r--src/bin/main.c56
3 files changed, 38 insertions, 21 deletions
diff --git a/src/bin/ipc.c b/src/bin/ipc.c
index 83b265c..318d5a7 100644
--- a/src/bin/ipc.c
+++ b/src/bin/ipc.c
@@ -94,6 +94,8 @@ ipc_init(void)
94 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 94 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
95 "name", name, EET_T_STRING); 95 "name", name, EET_T_STRING);
96 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 96 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
97 "theme", theme, EET_T_STRING);
98 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
97 "role", role, EET_T_STRING); 99 "role", role, EET_T_STRING);
98 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 100 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
99 "title", title, EET_T_STRING); 101 "title", title, EET_T_STRING);
diff --git a/src/bin/ipc.h b/src/bin/ipc.h
index 419f389..2290703 100644
--- a/src/bin/ipc.h
+++ b/src/bin/ipc.h
@@ -11,6 +11,7 @@ struct _Ipc_Instance
11 char *cd; 11 char *cd;
12 char *background; 12 char *background;
13 char *name; 13 char *name;
14 char *theme;
14 char *role; 15 char *role;
15 char *title; 16 char *title;
16 char *icon_name; 17 char *icon_name;
diff --git a/src/bin/main.c b/src/bin/main.c
index 2bed6c1..8e0bcad 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -27,6 +27,30 @@ Eina_Bool multisense_available = EINA_TRUE;
27static Config *_main_config = NULL; 27static Config *_main_config = NULL;
28 28
29static void 29static void
30_set_instance_theme(Ipc_Instance *inst)
31{
32 char path[PATH_MAX];
33 char theme_name[PATH_MAX];
34 const char *theme_path = (const char *)&path;
35
36 if (!inst->theme)
37 return;
38
39 if (eina_str_has_suffix(inst->theme, ".edj"))
40 eina_strlcpy(theme_name, inst->theme, sizeof(theme_name));
41 else
42 snprintf(theme_name, sizeof(theme_name), "%s.edj", inst->theme);
43
44 if (strchr(theme_name, '/'))
45 eina_strlcpy(path, theme_name, sizeof(path));
46 else
47 theme_path = theme_path_get(theme_name);
48
49 eina_stringshare_replace(&(inst->config->theme), theme_path);
50 inst->config->temporary = EINA_TRUE;
51}
52
53static void
30_check_multisense(void) 54_check_multisense(void)
31{ 55{
32 int enabled; 56 int enabled;
@@ -94,6 +118,7 @@ main_ipc_new(Ipc_Instance *inst)
94 if (inst->xterm_256color) nargc += 1; 118 if (inst->xterm_256color) nargc += 1;
95 if (inst->active_links) nargc += 1; 119 if (inst->active_links) nargc += 1;
96 if (inst->cmd) nargc += 2; 120 if (inst->cmd) nargc += 2;
121 if (inst->theme) nargc += 2;
97 122
98 nargv = calloc(nargc + 1, sizeof(char *)); 123 nargv = calloc(nargc + 1, sizeof(char *));
99 if (!nargv) return; 124 if (!nargv) return;
@@ -115,6 +140,11 @@ main_ipc_new(Ipc_Instance *inst)
115 nargv[i++] = "-n"; 140 nargv[i++] = "-n";
116 nargv[i++] = (char *)inst->name; 141 nargv[i++] = (char *)inst->name;
117 } 142 }
143 if (inst->theme)
144 {
145 nargv[i++] = "-t";
146 nargv[i++] = (char *)inst->theme;
147 }
118 if (inst->role) 148 if (inst->role)
119 { 149 {
120 nargv[i++] = "-r"; 150 nargv[i++] = "-r";
@@ -247,6 +277,9 @@ main_ipc_new(Ipc_Instance *inst)
247 277
248 win = win_evas_object_get(wn); 278 win = win_evas_object_get(wn);
249 config = win_config_get(wn); 279 config = win_config_get(wn);
280 inst->config = config;
281
282 _set_instance_theme(inst);
250 283
251 if (inst->background) 284 if (inst->background)
252 { 285 {
@@ -697,7 +730,6 @@ exit:
697EAPI_MAIN int 730EAPI_MAIN int
698elm_main(int argc, char **argv) 731elm_main(int argc, char **argv)
699{ 732{
700 char *theme = NULL;
701 char *geometry = NULL; 733 char *geometry = NULL;
702 char *video_module = NULL; 734 char *video_module = NULL;
703 Eina_Bool video_mute = 0xff; /* unset */ 735 Eina_Bool video_mute = 0xff; /* unset */
@@ -717,7 +749,7 @@ elm_main(int argc, char **argv)
717 Ecore_Getopt_Value values[] = { 749 Ecore_Getopt_Value values[] = {
718 ECORE_GETOPT_VALUE_BOOL(cmd_options), 750 ECORE_GETOPT_VALUE_BOOL(cmd_options),
719 ECORE_GETOPT_VALUE_STR(instance.cd), 751 ECORE_GETOPT_VALUE_STR(instance.cd),
720 ECORE_GETOPT_VALUE_STR(theme), 752 ECORE_GETOPT_VALUE_STR(instance.theme),
721 ECORE_GETOPT_VALUE_STR(instance.background), 753 ECORE_GETOPT_VALUE_STR(instance.background),
722 ECORE_GETOPT_VALUE_STR(geometry), 754 ECORE_GETOPT_VALUE_STR(geometry),
723 ECORE_GETOPT_VALUE_STR(instance.name), 755 ECORE_GETOPT_VALUE_STR(instance.name),
@@ -849,25 +881,7 @@ elm_main(int argc, char **argv)
849 881
850 _check_multisense(); 882 _check_multisense();
851 883
852 if (theme) 884 _set_instance_theme(&instance);
853 {
854 char path[PATH_MAX];
855 char theme_name[PATH_MAX];
856 const char *theme_path = (const char *)&path;
857
858 if (eina_str_has_suffix(theme, ".edj"))
859 eina_strlcpy(theme_name, theme, sizeof(theme_name));
860 else
861 snprintf(theme_name, sizeof(theme_name), "%s.edj", theme);
862
863 if (strchr(theme_name, '/'))
864 eina_strlcpy(path, theme_name, sizeof(path));
865 else
866 theme_path = theme_path_get(theme_name);
867
868 eina_stringshare_replace(&(instance.config->theme), theme_path);
869 instance.config->temporary = EINA_TRUE;
870 }
871 885
872 if (instance.background) 886 if (instance.background)
873 { 887 {