|| LOW || Power || Add suspend/hibernate w/ screen blank or low battery config option || || || ||
:)
SVN revision: 62655
value "desklock_autolock_idle" int: 0;
value "desklock_autolock_idle_timeout" double: 300.0000000000000000000000000;
value "desklock_use_custom_desklock" int: 0;
- value "desklock_ask_presentation" uchar: 1;
+ value "desklock_ask_presentation" uchar: 0;
value "desklock_ask_presentation_timeout" double: 30.0000000000000000000000000;
value "display_res_restore" int: 0;
value "display_res_width" int: 1;
value "display_res_height" int: 1;
value "display_res_hz" int: 0;
value "display_res_rotation" int: 0;
- value "screensaver_enable" int: 0;
- value "screensaver_timeout" int: 0;
+ value "screensaver_enable" int: 1;
+ value "screensaver_timeout" int: 60;
value "screensaver_interval" int: 5;
value "screensaver_blanking" int: 2;
value "screensaver_expose" int: 2;
value "screensaver_ask_presentation" uchar: 1;
value "screensaver_ask_presentation_timeout" double: 30.0000000000000000000000000;
- value "dpms_enable" int: 0;
- value "dpms_standby_enable" int: 0;
- value "dpms_suspend_enable" int: 0;
- value "dpms_off_enable" int: 0;
- value "dpms_standby_timeout" int: 1;
- value "dpms_suspend_timeout" int: 1;
- value "dpms_off_timeout" int: 1;
+ value "screensaver_suspend" uchar: 1;
+ value "screensaver_suspend_delay" double: 5.0000000000000000000000000;
+ value "dpms_enable" int: 1;
+ value "dpms_standby_enable" int: 1;
+ value "dpms_suspend_enable" int: 1;
+ value "dpms_off_enable" int: 1;
+ value "dpms_standby_timeout" int: 60;
+ value "dpms_suspend_timeout" int: 60;
+ value "dpms_off_timeout" int: 60;
value "clientlist_group_by" int: 0;
value "clientlist_include_all_zones" int: 0;
value "clientlist_separate_with" int: 0;
value "display_res_height" int: 1;
value "display_res_hz" int: 0;
value "display_res_rotation" int: 0;
- value "screensaver_enable" int: 0;
- value "screensaver_timeout" int: 0;
+ value "screensaver_enable" int: 1;
+ value "screensaver_timeout" int: 300;
value "screensaver_interval" int: 5;
value "screensaver_blanking" int: 2;
value "screensaver_expose" int: 2;
value "screensaver_ask_presentation" uchar: 1;
value "screensaver_ask_presentation_timeout" double: 30.0000000000000000000000000;
- value "dpms_enable" int: 0;
- value "dpms_standby_enable" int: 0;
- value "dpms_suspend_enable" int: 0;
- value "dpms_off_enable" int: 0;
- value "dpms_standby_timeout" int: 1;
- value "dpms_suspend_timeout" int: 1;
- value "dpms_off_timeout" int: 1;
+ value "screensaver_suspend" uchar: 0;
+ value "screensaver_suspend_delay" double: 15.0000000000000000000000000;
+ value "dpms_enable" int: 1;
+ value "dpms_standby_enable" int: 1;
+ value "dpms_suspend_enable" int: 1;
+ value "dpms_off_enable" int: 1;
+ value "dpms_standby_timeout" int: 300;
+ value "dpms_suspend_timeout" int: 300;
+ value "dpms_off_timeout" int: 300;
value "clientlist_group_by" int: 0;
value "clientlist_include_all_zones" int: 0;
value "clientlist_separate_with" int: 0;
E_CONFIG_VAL(D, T, screensaver_ask_presentation, UCHAR);
E_CONFIG_VAL(D, T, screensaver_ask_presentation_timeout, DOUBLE);
+ E_CONFIG_VAL(D, T, screensaver_suspend, UCHAR);
+ E_CONFIG_VAL(D, T, screensaver_suspend_delay, DOUBLE);
+
E_CONFIG_VAL(D, T, dpms_enable, INT);
E_CONFIG_VAL(D, T, dpms_standby_enable, INT);
E_CONFIG_VAL(D, T, dpms_suspend_enable, INT);
double desklock_autolock_idle_timeout; // GUI
int desklock_use_custom_desklock; // GUI
const char *desklock_custom_desklock_cmd; // GUI
- Eina_Bool desklock_ask_presentation; // GUI
- double desklock_ask_presentation_timeout; // GUI
+ unsigned char desklock_ask_presentation; // GUI
+ double desklock_ask_presentation_timeout; // GUI
int screensaver_enable; // GUI
int screensaver_timeout; // GUI
int screensaver_interval; // GUI
int screensaver_blanking; // GUI
int screensaver_expose; // GUI
- Eina_Bool screensaver_ask_presentation; // GUI
- double screensaver_ask_presentation_timeout; // GUI
+ unsigned char screensaver_ask_presentation; // GUI
+ double screensaver_ask_presentation_timeout; // GUI
+
+ unsigned char screensaver_suspend;
+ double screensaver_suspend_delay;
int dpms_enable; // GUI
int dpms_standby_enable; // GUI
int desk_flip_wrap; // GUI
int fullscreen_flip; // GUI
- const char *icon_theme; // GUI
- Eina_Bool icon_theme_overrides; // GUI
+ const char *icon_theme; // GUI
+ unsigned char icon_theme_overrides; // GUI
- int desk_flip_animate_mode; // GUI
- int desk_flip_animate_interpolation; // GUI
- double desk_flip_animate_time; // GUI
- Eina_Bool desk_flip_pan_bg;
- double desk_flip_pan_x_axis_factor;
- double desk_flip_pan_y_axis_factor;
+ int desk_flip_animate_mode; // GUI
+ int desk_flip_animate_interpolation; // GUI
+ double desk_flip_animate_time; // GUI
+ unsigned char desk_flip_pan_bg;
+ double desk_flip_pan_x_axis_factor;
+ double desk_flip_pan_y_axis_factor;
const char *wallpaper_import_last_dev; // INTERNAL
const char *wallpaper_import_last_path; // INTERNAL
struct {
struct {
- int icon_size;
+ int icon_size;
} main, secondary, extra;
- double timeout;
- unsigned char do_input;
- Eina_List *actions;
+ double timeout;
+ unsigned char do_input;
+ Eina_List *actions;
} syscon;
struct {
- Eina_Bool presentation;
- Eina_Bool offline;
+ unsigned char presentation;
+ unsigned char offline;
} mode;
struct {
- double expire_timeout;
- Eina_Bool show_run_dialog;
- Eina_Bool show_exit_dialog;
+ double expire_timeout;
+ unsigned char show_run_dialog;
+ unsigned char show_exit_dialog;
} exec;
unsigned char null_container_win;
static int _e_screensaver_blanking = 0;
static int _e_screensaver_expose = 0;
+static Ecore_Timer *_e_screensaver_suspend_timer = NULL;
+
EAPI void
e_screensaver_update(void)
{
}
static Eina_Bool
+_e_screensaver_suspend_cb(void *data __UNUSED__)
+{
+ _e_screensaver_suspend_timer = NULL;
+ if (e_config->screensaver_suspend)
+ e_sys_action_do(E_SYS_SUSPEND, NULL);
+ return EINA_FALSE;
+}
+
+static Eina_Bool
_e_screensaver_handler_screensaver_notify_cb(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_X_Event_Screensaver_Notify *e = event;
if (e->on)
{
+ if (_e_screensaver_suspend_timer)
+ {
+ ecore_timer_del(_e_screensaver_suspend_timer);
+ _e_screensaver_suspend_timer = NULL;
+ }
+ if (e_config->screensaver_suspend)
+ _e_screensaver_suspend_timer =
+ ecore_timer_add(e_config->screensaver_suspend_delay,
+ _e_screensaver_suspend_cb, NULL);
+ }
+ else
+ {
+ if (_e_screensaver_suspend_timer)
+ {
+ ecore_timer_del(_e_screensaver_suspend_timer);
+ _e_screensaver_suspend_timer = NULL;
+ }
+ }
+
+ if (e->on)
+ {
last_start = ecore_loop_time_get();
_e_screensaver_ask_presentation_count = 0;
}
EINTERN int
e_screensaver_shutdown(void)
{
+ if (_e_screensaver_suspend_timer)
+ {
+ ecore_timer_del(_e_screensaver_suspend_timer);
+ _e_screensaver_suspend_timer = NULL;
+ }
if (_e_screensaver_handler_config_mode)
{
ecore_event_handler_del(_e_screensaver_handler_config_mode);
int alert_percent;
int dismiss_alert;
int alert_timeout;
+ int suspend_below;
int force_mode; // 0 == auto, 1 == batget, 2 == subsystem
struct
{
cfdata->alert_percent = battery_config->alert_p;
cfdata->poll_interval = battery_config->poll_interval;
cfdata->alert_timeout = battery_config->alert_timeout;
+ cfdata->suspend_below = battery_config->suspend_below;
cfdata->force_mode = battery_config->force_mode;
#ifdef HAVE_EEZE
cfdata->fuzzy = battery_config->fuzzy;
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f ticks"), 1, 256, 4, 0,
NULL, &(cfdata->poll_interval), 100);
e_widget_table_object_append(o, ob, 0, 1, 1, 1, 1, 0, 1, 0);
+
+ ob = e_widget_label_add(evas, _("Suspend when below:"));
+ e_widget_table_object_append(o, ob, 0, 2, 1, 1, 1, 0, 1, 0);
+ ob = e_widget_slider_add(evas, 1, 0, _("%1.0f %%"), 0, 50, 1, 0,
+ NULL, &(cfdata->suspend_below), 100);
+ e_widget_table_object_append(o, ob, 0, 3, 1, 1, 1, 0, 1, 0);
+
e_widget_toolbook_page_append(otb, NULL, _("Polling"), o, 1, 0, 1, 0,
0.5, 0.0);
(cfdata->alert_percent != battery_config->alert_p) ||
(cfdata->poll_interval != battery_config->poll_interval) ||
(cfdata->alert_timeout != battery_config->alert_timeout) ||
+ (cfdata->suspend_below != battery_config->suspend_below) ||
#ifdef HAVE_EEZE
(cfdata->fuzzy != battery_config->fuzzy) ||
#endif
}
else if (have_power || ((time_left / 60) > battery_config->alert))
_battery_warning_popup_destroy(inst);
+ if ((have_battery) && (!have_power) && (full >= 0) &&
+ (battery_config->suspend_below > 0) &&
+ (full < battery_config->suspend_below))
+ e_sys_action_do(E_SYS_SUSPEND, NULL);
}
if (!have_battery)
e_powersave_mode_set(E_POWERSAVE_MODE_LOW);
int have_power = 0;
if (sscanf(ev->lines[i].line, "%i %i %i %i %i", &full, &time_left, &time_full,
- &have_battery, &have_power) == 5)
+ &have_battery, &have_power) == 5)
_battery_update(full, time_left, time_full,
- have_battery, have_power);
+ have_battery, have_power);
else
e_powersave_mode_set(E_POWERSAVE_MODE_LOW);
}
E_CONFIG_VAL(D, T, alert, INT);
E_CONFIG_VAL(D, T, alert_p, INT);
E_CONFIG_VAL(D, T, alert_timeout, INT);
+ E_CONFIG_VAL(D, T, suspend_below, INT);
E_CONFIG_VAL(D, T, force_mode, INT);
#ifdef HAVE_EEZE
E_CONFIG_VAL(D, T, fuzzy, INT);
battery_config->alert = 30;
battery_config->alert_p = 10;
battery_config->alert_timeout = 0;
+ battery_config->suspend_below = 0;
battery_config->force_mode = 0;
#ifdef HAVE_EEZE
battery_config->fuzzy = 0;
E_CONFIG_LIMIT(battery_config->alert, 0, 60);
E_CONFIG_LIMIT(battery_config->alert_p, 0, 100);
E_CONFIG_LIMIT(battery_config->alert_timeout, 0, 300);
+ E_CONFIG_LIMIT(battery_config->suspend_below, 0, 50);
E_CONFIG_LIMIT(battery_config->force_mode, 0, 2);
battery_config->module = m;
int alert; /* Alert on minutes remaining */
int alert_p; /* Alert on percentage remaining */
int alert_timeout; /* Popup dismissal timeout */
+ int suspend_below; /* Suspend if batter drops below this level */
int force_mode; /* force use of batget or hal */
/* just config state */
E_Module *module;
int exposures;
int ask_presentation;
double ask_presentation_timeout;
+
+ int screensaver_suspend;
+ double screensaver_suspend_delay;
Eina_List *disable_list;
cfdata->blanking = e_config->screensaver_blanking;
cfdata->exposures = e_config->screensaver_expose;
cfdata->ask_presentation = e_config->screensaver_ask_presentation;
- cfdata->ask_presentation_timeout =
- e_config->screensaver_ask_presentation_timeout;
+ cfdata->ask_presentation_timeout = e_config->screensaver_ask_presentation_timeout;
+ cfdata->screensaver_suspend = e_config->screensaver_suspend;
+ cfdata->screensaver_suspend_delay = e_config->screensaver_suspend_delay;
}
static void *
e_config->screensaver_blanking = cfdata->blanking;
e_config->screensaver_expose = cfdata->exposures;
e_config->screensaver_ask_presentation = cfdata->ask_presentation;
- e_config->screensaver_ask_presentation_timeout =
- cfdata->ask_presentation_timeout;
-
+ e_config->screensaver_ask_presentation_timeout = cfdata->ask_presentation_timeout;
+ e_config->screensaver_suspend = cfdata->screensaver_suspend;
+ e_config->screensaver_suspend_delay = cfdata->screensaver_suspend_delay;
+
/* Apply settings */
e_screensaver_update();
(e_config->screensaver_blanking != cfdata->blanking) ||
(e_config->screensaver_expose != cfdata->exposures) ||
(e_config->screensaver_ask_presentation != cfdata->ask_presentation) ||
- (e_config->screensaver_ask_presentation_timeout != cfdata->ask_presentation_timeout));
+ (e_config->screensaver_ask_presentation_timeout != cfdata->ask_presentation_timeout) ||
+ (e_config->screensaver_suspend != cfdata->screensaver_suspend) ||
+ (e_config->screensaver_suspend_delay != cfdata->screensaver_suspend_delay));
}
static Evas_Object *
&(cfdata->enable_screensaver));
e_widget_on_change_hook_set(ow, _cb_disable, cfdata);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
+
+ ow = e_widget_check_add(evas, _("Suspend on blank"),
+ &(cfdata->screensaver_suspend));
+ cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
+ e_widget_list_object_append(ol, ow, 1, 1, 0.5);
+ ow = e_widget_label_add(evas, _("Delay until suspend"));
+ cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
+ e_widget_list_object_append(ol, ow, 1, 1, 0.5);
+ ow = e_widget_slider_add(evas, 1, 0, _("%1.0f seconds"),
+ 1.0, 20.0, 1.0, 0, &(cfdata->screensaver_suspend_delay), NULL, 100);
+ cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
+ e_widget_list_object_append(ol, ow, 1, 1, 0.5);
+
e_widget_toolbook_page_append(otb, NULL, _("Screensaver"), ol,
1, 0, 1, 0, 0.5, 0.0);