From ca0f8f8712e27b44cc6b42f7b64f0ba404758545 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Mon, 27 Jul 2009 13:34:20 +0200 Subject: [PATCH] Fix: If there is no battery then we don't care about the status --- src/conky.c | 4 ++-- src/conky.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conky.c b/src/conky.c index bf656a39..c36fbcf0 100644 --- a/src/conky.c +++ b/src/conky.c @@ -7138,7 +7138,7 @@ static void main_loop(void) next_update_time = get_time(); info.looped = 0; while (terminate == 0 && (total_run_times == 0 || info.looped < total_run_times)) { - if(update_interval_bat != update_interval_old) { + if(update_interval_bat != NOBATTERY && update_interval_bat != update_interval_old) { char buf[max_user_text]; get_battery_short_status(buf, max_user_text, "BAT0"); @@ -7888,7 +7888,7 @@ static void set_default_configurations(void) no_buffers = 1; update_interval = 3.0; update_interval_old = update_interval; - update_interval_bat = update_interval; + update_interval_bat = NOBATTERY; info.music_player_interval = 1.0; stuff_in_uppercase = 0; info.users.number = 1; diff --git a/src/conky.h b/src/conky.h index 8ed78b20..1193a7c3 100644 --- a/src/conky.h +++ b/src/conky.h @@ -374,4 +374,6 @@ extern enum x_initialiser_state x_initialised; #define DEFAULT_TEXT_BUFFER_SIZE_S "##DEFAULT_TEXT_BUFFER_SIZE" +#define NOBATTERY 0 + #endif /* _conky_h_ */