diff --git a/AUTHORS b/AUTHORS index 6a619c86..4e80aff5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -181,6 +181,9 @@ Lucas Brutschy MLDonkey patch if constructs patch +Marcus Huesgen + battery_bar fix + Michal Januszewski hddtemp support diff --git a/ChangeLog b/ChangeLog index 45a46ed0..b6b08803 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * Fixed compilation with --disable-x11 * Fixed linux.c compilation problem due to (suspected) broken linux headers + * $battery_bar sysfs fix (thanks Marcus) 2008-03-22 * Conky 1.5.0 released diff --git a/src/linux.c b/src/linux.c index e28bfb5c..d4a5860d 100644 --- a/src/linux.c +++ b/src/linux.c @@ -1850,14 +1850,15 @@ int get_battery_perct(const char *bat) if (fgets(buf, 256, sysfs_bat_fp[idx]) == NULL) break; - if (strncmp(buf, "POWER_SUPPLY_CHARGE_NOW=", 24) == 0) + if (strncmp(buf, "POWER_SUPPLY_CHARGE_NOW=", 24) == 0) { sscanf(buf, "POWER_SUPPLY_CHARGE_NOW=%d", &remaining_capacity); - else if (strncmp(buf, "POWER_SUPPLY_CHARGE_FULL=",25) != 0) - sscanf(buf, "POWER_SUPPLY_CHARGE_FULL=%d", &acpi_last_full[idx]); - else if (strncmp(buf, "POWER_SUPPLY_ENERGY_NOW=", 24) == 0) + } else if (strncmp(buf, "POWER_SUPPLY_CHARGE_FULL=",25) == 0) { + sscanf(buf, "POWER_SUPPLY_CHARGE_FULL=%d", &acpi_design_capacity[idx]); + } else if (strncmp(buf, "POWER_SUPPLY_ENERGY_NOW=", 24) == 0) { sscanf(buf, "POWER_SUPPLY_ENERGY_NOW=%d", &remaining_capacity); - else if (strncmp(buf, "POWER_SUPPLY_ENERGY_FULL=",25) != 0) - sscanf(buf, "POWER_SUPPLY_ENERGY_FULL=%d", &acpi_last_full[idx]); + } else if (strncmp(buf, "POWER_SUPPLY_ENERGY_FULL=",25) == 0) { + sscanf(buf, "POWER_SUPPLY_ENERGY_FULL=%d", &acpi_design_capacity[idx]); + } } fclose(sysfs_bat_fp[idx]);