Created attachment 169122 [details] Patch sysutils/conky on FreeBSD does not display battery status correctly. Basically, the only thing that works is ${battery}. ${battery_short} does not display the shortened string in several cases. ${battery_percent} always displays 100% regardless of the actual load state of the battery. ${battery_bar} therefore also just displays a 100% bar. The attached patch fixes all of these. Most notably, the previous implementation of ${battery_percent} is just wrong - it wouldn't display the available battery capacity (in percent of the total capacity), but rather the "wear state" of the battery, i.e. how much of the total capacity it has "lost" during it use in comparison to the available capacity when it was brand-new. (This is admittedly an interesting parameter on it's own, but clearly mostly useless for the purposes of conky.)
Committed, with minor changes. Thanks!
A commit references this bug: Author: lme Date: Tue Apr 26 11:32:21 UTC 2016 New revision: 414044 URL: https://svnweb.freebsd.org/changeset/ports/414044 Log: - Fix battery percentage calculation and add support for ${battery_short} and ${battery_bar} [1] - Remove a bogus __FreeBSD_kernel__ check in freebsd.c - Re-gen patches with "make makepatch" - Bump PORTREVISION PR: 208651 [1] Submitted by: Helge Oldach <freebsd@oldach.net> Approved by: maintainer timeout (17 days) MFH: 2016Q2 Changes: head/sysutils/conky/Makefile head/sysutils/conky/files/patch-configure head/sysutils/conky/files/patch-lua-cairo.pkg head/sysutils/conky/files/patch-src-conky.c head/sysutils/conky/files/patch-src-freebsd.c head/sysutils/conky/files/patch-src-freebsd.h head/sysutils/conky/files/patch-src-fs.c
A commit references this bug: Author: lme Date: Thu Apr 28 16:59:28 UTC 2016 New revision: 414185 URL: https://svnweb.freebsd.org/changeset/ports/414185 Log: MFH: r414044 - Fix battery percentage calculation and add support for ${battery_short} and ${battery_bar} [1] - Remove a bogus __FreeBSD_kernel__ check in freebsd.c - Re-gen patches with "make makepatch" - Bump PORTREVISION PR: 208651 [1] Submitted by: Helge Oldach <freebsd@oldach.net> Approved by: maintainer timeout (17 days) Approved by: ports-secteam (junovich) Changes: _U branches/2016Q2/ branches/2016Q2/sysutils/conky/Makefile branches/2016Q2/sysutils/conky/files/patch-configure branches/2016Q2/sysutils/conky/files/patch-lua-cairo.pkg branches/2016Q2/sysutils/conky/files/patch-src-conky.c branches/2016Q2/sysutils/conky/files/patch-src-freebsd.c branches/2016Q2/sysutils/conky/files/patch-src-freebsd.h branches/2016Q2/sysutils/conky/files/patch-src-fs.c