mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-26 00:28:25 +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:
parent
7613414296
commit
c2c01423a8
3
AUTHORS
3
AUTHORS
@ -181,6 +181,9 @@ Lucas Brutschy <lbrutschy at users dot sourceforge dot net>
|
||||
MLDonkey patch
|
||||
if constructs patch
|
||||
|
||||
Marcus Huesgen <marcus dot huesgen at googlemail dot com>
|
||||
battery_bar fix
|
||||
|
||||
Michal Januszewski <spock at gentoo dot org>
|
||||
hddtemp support
|
||||
|
||||
|
@ -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
|
||||
|
13
src/linux.c
13
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]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user