main: add --colorscheme

This commit is contained in:
Boris Faure 2020-11-09 22:26:23 +01:00
parent 7bb1639260
commit 0a85423759
Signed by untrusted user who does not match committer: borisfaure
GPG Key ID: 35C0410516166BE8
4 changed files with 24 additions and 0 deletions

View File

@ -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.
.

View File

@ -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,

View File

@ -12,6 +12,7 @@ struct _Ipc_Instance
char *background;
char *name;
char *theme;
char *colorscheme;
char *role;
char *title;
char *icon_name;

View File

@ -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),