From da7599983227facf8538932c86d2df986a3765e0 Mon Sep 17 00:00:00 2001 From: Chris Lee <@klee93> Date: Sat, 9 Mar 2019 12:29:31 +0100 Subject: [PATCH] add env var to debug battery blink --- src/battery/battery.c | 4 ++-- src/init.c | 1 + src/panel.c | 2 +- src/panel.h | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/battery/battery.c b/src/battery/battery.c index 346f5e9..7328900 100644 --- a/src/battery/battery.c +++ b/src/battery/battery.c @@ -408,8 +408,8 @@ void update_battery_tick(void *arg) } if (!battery_blink_timer.enabled_) { - if (battery_state.percentage < battery_low_status && - battery_state.state == BATTERY_DISCHARGING) { + if ((battery_state.percentage < battery_low_status && + battery_state.state == BATTERY_DISCHARGING) || debug_blink) { change_timer(&battery_blink_timer, true, 10, 1000, blink_battery, 0); battery_warn = TRUE; } diff --git a/src/init.c b/src/init.c index d0c22af..772997a 100644 --- a/src/init.c +++ b/src/init.c @@ -107,6 +107,7 @@ void handle_env_vars() debug_thumbnails = getenv("DEBUG_THUMBNAILS") != NULL; debug_timers = getenv("DEBUG_TIMERS") != NULL; debug_executors = getenv("DEBUG_EXECUTORS") != NULL; + debug_blink = getenv("DEBUG_BLINK") != NULL; thumb_use_shm = getenv("TINT2_THUMBNAIL_SHM") != NULL; if (debug_fps) { init_fps_distribution(); diff --git a/src/panel.c b/src/panel.c index e1878af..542c087 100644 --- a/src/panel.c +++ b/src/panel.c @@ -60,7 +60,7 @@ gboolean debug_geometry; gboolean debug_gradients; gboolean startup_notifications; gboolean debug_thumbnails; - +gboolean debug_blink; gboolean panel_autohide; int panel_autohide_show_timeout; int panel_autohide_hide_timeout; diff --git a/src/panel.h b/src/panel.h index 50dbc47..cf1373c 100644 --- a/src/panel.h +++ b/src/panel.h @@ -99,6 +99,7 @@ extern gboolean debug_thumbnails; extern double ui_scale_dpi_ref; extern double ui_scale_monitor_size_ref; extern gboolean thumb_use_shm; +extern gboolean debug_blink; typedef struct Panel { Area area;