Bug 208651 - sysutils/conky: correct battery variables [patch]
Summary: sysutils/conky: correct battery variables [patch]
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Lars Engels
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-04-09 11:33 UTC by Helge Oldach
Modified: 2016-04-28 17:00 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (ntarmos)


Attachments
Patch (1.94 KB, text/plain)
2016-04-09 11:33 UTC, Helge Oldach
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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