1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-27 17:18:33 +00:00

* $battery_bar sysfs fix (thanks Marcus)

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1043 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Brenden Matthews 2008-03-24 05:09:09 +00:00
parent 7613414296
commit c2c01423a8
3 changed files with 11 additions and 6 deletions

View File

@ -181,6 +181,9 @@ Lucas Brutschy <lbrutschy at users dot sourceforge dot net>
MLDonkey patch MLDonkey patch
if constructs patch if constructs patch
Marcus Huesgen <marcus dot huesgen at googlemail dot com>
battery_bar fix
Michal Januszewski <spock at gentoo dot org> Michal Januszewski <spock at gentoo dot org>
hddtemp support hddtemp support

View File

@ -4,6 +4,7 @@
* Fixed compilation with --disable-x11 * Fixed compilation with --disable-x11
* Fixed linux.c compilation problem due to (suspected) broken linux * Fixed linux.c compilation problem due to (suspected) broken linux
headers headers
* $battery_bar sysfs fix (thanks Marcus)
2008-03-22 2008-03-22
* Conky 1.5.0 released * Conky 1.5.0 released

View File

@ -1850,14 +1850,15 @@ int get_battery_perct(const char *bat)
if (fgets(buf, 256, sysfs_bat_fp[idx]) == NULL) if (fgets(buf, 256, sysfs_bat_fp[idx]) == NULL)
break; 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); sscanf(buf, "POWER_SUPPLY_CHARGE_NOW=%d", &remaining_capacity);
else if (strncmp(buf, "POWER_SUPPLY_CHARGE_FULL=",25) != 0) } else if (strncmp(buf, "POWER_SUPPLY_CHARGE_FULL=",25) == 0) {
sscanf(buf, "POWER_SUPPLY_CHARGE_FULL=%d", &acpi_last_full[idx]); sscanf(buf, "POWER_SUPPLY_CHARGE_FULL=%d", &acpi_design_capacity[idx]);
else if (strncmp(buf, "POWER_SUPPLY_ENERGY_NOW=", 24) == 0) } else if (strncmp(buf, "POWER_SUPPLY_ENERGY_NOW=", 24) == 0) {
sscanf(buf, "POWER_SUPPLY_ENERGY_NOW=%d", &remaining_capacity); sscanf(buf, "POWER_SUPPLY_ENERGY_NOW=%d", &remaining_capacity);
else if (strncmp(buf, "POWER_SUPPLY_ENERGY_FULL=",25) != 0) } else if (strncmp(buf, "POWER_SUPPLY_ENERGY_FULL=",25) == 0) {
sscanf(buf, "POWER_SUPPLY_ENERGY_FULL=%d", &acpi_last_full[idx]); sscanf(buf, "POWER_SUPPLY_ENERGY_FULL=%d", &acpi_design_capacity[idx]);
}
} }
fclose(sysfs_bat_fp[idx]); fclose(sysfs_bat_fp[idx]);