billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=0a85423759b5db0616e500c050371260742fcd47

commit 0a85423759b5db0616e500c050371260742fcd47
Author: Boris Faure <bill...@gmail.com>
Date:   Mon Nov 9 22:26:23 2020 +0100

    main: add --colorscheme
---
 man/terminology.1 |  5 +++++
 src/bin/ipc.c     |  2 ++
 src/bin/ipc.h     |  1 +
 src/bin/main.c    | 16 ++++++++++++++++
 4 files changed, 24 insertions(+)

diff --git a/man/terminology.1 b/man/terminology.1
index 1e2d943..3662837 100644
--- a/man/terminology.1
+++ b/man/terminology.1
@@ -167,6 +167,11 @@ Scaling factor to use on the UI.
 Type: DOUBLE.
 .
 .TP
+.B \-\-colorscheme=COLORSCHEME
+Use the named color scheme.
+Type: STR.
+.
+.TP
 .B \-V, \-\-version
 Show program version.
 .
diff --git a/src/bin/ipc.c b/src/bin/ipc.c
index 83c16a3..6cad2b9 100644
--- a/src/bin/ipc.c
+++ b/src/bin/ipc.c
@@ -104,6 +104,8 @@ ipc_init(void)
                                  "name", name, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
                                  "theme", theme, EET_T_STRING);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
+                                 "colorscheme", colorscheme, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
                                  "role", role, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
diff --git a/src/bin/ipc.h b/src/bin/ipc.h
index 26349b9..852915d 100644
--- a/src/bin/ipc.h
+++ b/src/bin/ipc.h
@@ -12,6 +12,7 @@ struct _Ipc_Instance
    char *background;
    char *name;
    char *theme;
+   char *colorscheme;
    char *role;
    char *title;
    char *icon_name;
diff --git a/src/bin/main.c b/src/bin/main.c
index 3e9fe7e..149738f 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -57,6 +57,13 @@ _configure_instance(Ipc_Instance *inst)
 
    _set_instance_theme(inst);
 
+   if (inst->colorscheme)
+   {
+        eina_stringshare_replace(&(config->color_scheme_name), 
inst->colorscheme);
+        config_compute_color_scheme(config);
+        config->temporary = EINA_TRUE;
+   }
+
    if (inst->background)
      {
         eina_stringshare_replace(&(config->background), inst->background);
@@ -221,6 +228,7 @@ main_ipc_new(Ipc_Instance *inst)
    if (inst->visual_bell) nargc += 1;
    if (inst->cmd) nargc += 2;
    if (inst->theme) nargc += 2;
+   if (inst->colorscheme) nargc += 2;
 
    nargv = calloc(nargc + 1, sizeof(char *));
    if (!nargv) return;
@@ -247,6 +255,11 @@ main_ipc_new(Ipc_Instance *inst)
         nargv[i++] = "-t";
         nargv[i++] = (char *)inst->theme;
      }
+   if (inst->colorscheme)
+     {
+        nargv[i++] = "--colorscheme";
+        nargv[i++] = (char *)inst->colorscheme;
+     }
    if (inst->role)
      {
         nargv[i++] = "-r";
@@ -500,6 +513,8 @@ static Ecore_Getopt options = {
                               gettext_noop("Highlight links")),
       ECORE_GETOPT_STORE_BOOL('\0', "no-wizard",
                               gettext_noop("Do not display wizard on start 
up")),
+      ECORE_GETOPT_STORE_STR ('\0', "colorscheme",
+                              gettext_noop("Use the named color scheme")),
 
       ECORE_GETOPT_VERSION   ('V', "version"),
       ECORE_GETOPT_COPYRIGHT ('C', "copyright"),
@@ -832,6 +847,7 @@ elm_main(int argc, char **argv)
      ECORE_GETOPT_VALUE_DOUBLE(scale),
      ECORE_GETOPT_VALUE_BOOL(instance.active_links),
      ECORE_GETOPT_VALUE_BOOL(no_wizard),
+     ECORE_GETOPT_VALUE_STR(instance.colorscheme),
 
      ECORE_GETOPT_VALUE_BOOL(quit_option),
      ECORE_GETOPT_VALUE_BOOL(quit_option),

-- 


Reply via email to