backlight - add option for ddc to work or not

just because libddcutil is installed doesnt mean someone always wants
backlight on monitors controlled, so allow an option.
pull/1/head
Carsten Haitzler 9 months ago
parent 58462390be
commit 29e1a12da3
  1. 3
      data/config/default/e.src
  2. 3
      data/config/standard/e.src
  3. 3
      data/config/tiling/e.src
  4. 3
      src/bin/e_backlight.c
  5. 8
      src/bin/e_config.c
  6. 3
      src/bin/e_config.h
  7. 9
      src/modules/conf_display/e_int_config_dpms.c

@ -1,5 +1,5 @@
group "E_Config" struct {
value "config_version" int: 1000033;
value "config_version" int: 1000035;
value "config_type" uint: 0; // this profile seems to just be super minimalist
value "desktop_default_name" string: "%i-%i";
value "desktop_default_window_profile" string: "";
@ -207,6 +207,7 @@ group "E_Config" struct {
value "backlight.timer" double: 30.0;
value "backlight.battery_timer" double: 20.0;
value "backlight.idle_dim" uchar: 1;
value "backlight.ddc" uchar: 0;
value "device_desktop" int: 0;
value "device_auto_mount" int: 0;
value "device_auto_open" int: 0;

@ -1,5 +1,5 @@
group "E_Config" struct {
value "config_version" int: 1000033;
value "config_version" int: 1000035;
value "config_type" uint: 3;
value "desktop_default_name" string: "%i-%i";
value "desktop_default_window_profile" string: "standard";
@ -200,6 +200,7 @@ group "E_Config" struct {
value "backlight.timer" double: 30.0;
value "backlight.battery_timer" double: 20.0;
value "backlight.idle_dim" uchar: 1;
value "backlight.ddc" uchar: 1;
value "deskenv.load_xrdb" uchar: 1;
value "deskenv.load_xmodmap" uchar: 1;
value "deskenv.load_gnome" uchar: 0;

@ -1,5 +1,5 @@
group "E_Config" struct {
value "config_version" int: 1000033;
value "config_version" int: 1000035;
value "config_type" uint: 3;
value "desktop_default_name" string: "%i-%i";
value "desktop_default_window_profile" string: "standard";
@ -200,6 +200,7 @@ group "E_Config" struct {
value "backlight.timer" double: 30.0;
value "backlight.battery_timer" double: 20.0;
value "backlight.idle_dim" uchar: 1;
value "backlight.ddc" uchar: 1;
value "deskenv.load_xrdb" uchar: 1;
value "deskenv.load_xmodmap" uchar: 1;
value "deskenv.load_gnome" uchar: 0;

@ -254,7 +254,8 @@ _backlight_devices_device_set(Backlight_Device *bd, double val)
// fprintf(stderr, "BL: ddc bklight %1.3f @ %1.3f\n", bd->val, ecore_time_get());
if (bd->ddc_max) fval = bd->val * (double)bd->ddc_max;
else fval = bd->val * 100.0;
e_system_send("ddc-val-set", "%s %i %i", bd->dev + 4, 0x10, (int)(fval)); // backlight val in e_system_ddc.c
if (e_config->backlight.ddc)
e_system_send("ddc-val-set", "%s %i %i", bd->dev + 4, 0x10, (int)(fval)); // backlight val in e_system_ddc.c
ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL);
}
else

@ -942,6 +942,7 @@ _e_config_edd_init(Eina_Bool old)
E_CONFIG_VAL(D, T, backlight.battery_timer, DOUBLE);
E_CONFIG_VAL(D, T, backlight.sysdev, STR);
E_CONFIG_VAL(D, T, backlight.idle_dim, UCHAR);
E_CONFIG_VAL(D, T, backlight.ddc, UCHAR);
E_CONFIG_VAL(D, T, deskenv.load_xrdb, UCHAR);
E_CONFIG_VAL(D, T, deskenv.load_xmodmap, UCHAR);
@ -1808,6 +1809,12 @@ e_config_load(void)
e_config->scale.set_xapp_dpi = 1;
e_config_save_queue();
}
CONFIG_VERSION_CHECK(35)
{
CONFIG_VERSION_UPDATE_INFO(35);
e_config->backlight.ddc = 1;
e_config_save_queue();
}
}
elm_config_profile_set(_e_config_profile);
if (!e_config->remember_internal_fm_windows)
@ -1992,6 +1999,7 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->backlight.normal, 0.05, 1.0);
E_CONFIG_LIMIT(e_config->backlight.dim, 0.05, 1.0);
E_CONFIG_LIMIT(e_config->backlight.idle_dim, 0, 1);
E_CONFIG_LIMIT(e_config->backlight.ddc, 0, 1);
E_CONFIG_LIMIT(e_config->keyboard.repeat_delay, -1, 1000); // 1 second
E_CONFIG_LIMIT(e_config->keyboard.repeat_rate, -1, 1000); // 1 second

@ -47,7 +47,7 @@ typedef enum
/* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in
*/
#define E_CONFIG_FILE_GENERATION 34
#define E_CONFIG_FILE_GENERATION 35
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
#define E_CONFIG_BINDINGS_VERSION 0 // DO NOT INCREMENT UNLESS YOU WANT TO WIPE ALL BINDINGS!!!!!
@ -371,6 +371,7 @@ struct _E_Config
double battery_timer; // GUI
const char *sysdev; // GUI
unsigned char idle_dim; // GUI
unsigned char ddc; // GUI
} backlight;
struct

@ -17,6 +17,7 @@ struct _E_Config_Dialog_Data
Evas_Object *backlight_slider_fade;
int enable_idle_dim;
int ddc;
double backlight_normal;
double backlight_dim;
@ -56,6 +57,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->backlight_dim = e_config->backlight.dim * 100.0;
cfdata->backlight_transition = e_config->backlight.transition;
cfdata->enable_idle_dim = e_config->backlight.idle_dim;
cfdata->ddc = e_config->backlight.ddc;
cfdata->backlight_timeout = e_config->backlight.timer;
cfdata->backlight_battery_timeout = e_config->backlight.battery_timer;
}
@ -87,6 +89,7 @@ _apply_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
e_config->backlight.timer = lround(cfdata->backlight_timeout);
e_config->backlight.battery_timer = lround(cfdata->backlight_battery_timeout);
e_config->backlight.idle_dim = cfdata->enable_idle_dim;
e_config->backlight.ddc = cfdata->ddc;
e_backlight_mode_set(NULL, E_BACKLIGHT_MODE_NORMAL);
e_backlight_level_set(NULL, e_config->backlight.normal, -1.0);
@ -121,7 +124,8 @@ _advanced_check_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *
(!EINA_DBL_EQ(e_config->backlight.transition, cfdata->backlight_transition)) ||
(!EINA_DBL_EQ(e_config->backlight.timer, cfdata->backlight_timeout)) ||
(!EINA_DBL_EQ(e_config->backlight.battery_timer, cfdata->backlight_battery_timeout)) ||
(e_config->backlight.idle_dim != cfdata->enable_idle_dim);
(e_config->backlight.idle_dim != cfdata->enable_idle_dim) ||
(e_config->backlight.ddc != cfdata->ddc);
}
static int
@ -152,6 +156,9 @@ _advanced_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_
&(cfdata->backlight_dim), NULL, 100);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_check_add(evas, _("Desktop Monitor Support (DDC)"), &(cfdata->ddc));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_check_add(evas, _("Idle Fade Time"), &(cfdata->enable_idle_dim));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f second(s)"), 5.0, 300.0, 1.0, 0,

Loading…
Cancel
Save