Bug 208651

Summary: sysutils/conky: correct battery variables [patch]
Product: Ports & Packages Reporter: Helge Oldach <freebsd>
Component: Individual Port(s)Assignee: Lars Engels <lme>
Status: Closed FIXED    
Severity: Affects Many People CC: freebsd, lme, ntarmos
Priority: --- Keywords: patch
Version: LatestFlags: bugzilla: maintainer-feedback? (ntarmos)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch none

Description Helge Oldach 2016-04-09 11:33:18 UTC
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.)
Comment 1 Lars Engels freebsd_committer freebsd_triage 2016-04-26 11:32:43 UTC
Committed, with minor changes. Thanks!
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-04-26 11:32:57 UTC
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
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-04-28 17:00:29 UTC
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