Bug 262018 - x11/lumina-core: Support battery monitoring on non-x86 systems
Summary: x11/lumina-core: Support battery monitoring on non-x86 systems
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: Loïc Bartoletti
URL:
Keywords: feature, needs-qa
Depends on:
Blocks:
 
Reported: 2022-02-17 15:35 UTC by Jason W. Bacon
Modified: 2022-02-23 14:47 UTC (History)
0 users

See Also:
lbartoletti: maintainer-feedback+
koobs: merge-quarterly?


Attachments
Patch to fix battery monitoring on non-x86 (5.01 KB, patch)
2022-02-17 15:35 UTC, Jason W. Bacon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason W. Bacon freebsd_committer freebsd_triage 2022-02-17 15:35:56 UTC
Created attachment 231894 [details]
Patch to fix battery monitoring on non-x86

The lumina battery monitoring is currently implemented by shelling out "apm" commands.  The apm command does not exist on arm, powerpc, or riscv.  The patches attached switch to a sysctl() interface to directly query acpi_battery, so they should work on any platform as well as being more efficient.

I would hold off on committing them, though, pending review from upstream:

https://github.com/lumina-desktop/lumina/issues/765

If there are no major issues, then maybe we can patch the port until these changes make it into the upstream dist.
Comment 1 Loïc Bartoletti freebsd_committer freebsd_triage 2022-02-22 19:40:21 UTC
LGTM, ship it! Thanks.
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-02-23 14:46:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f7972afbeec54358e5f80c54baf473b5add0ac92

commit f7972afbeec54358e5f80c54baf473b5add0ac92
Author:     Jason W. Bacon <jwb@FreeBSD.org>
AuthorDate: 2022-02-23 14:43:06 +0000
Commit:     Jason W. Bacon <jwb@FreeBSD.org>
CommitDate: 2022-02-23 14:46:06 +0000

    x11/lumina-core: Replace apm battery monitoring with sysctls()

    The apm command does not exist on arm, powerpc, or riscv.
    This also reduces CPU time for lumina-desktop.
    Patches have been proposed to upstream.

    PR:             262018
    Approved by:    lbartoletti

 x11/lumina-core/Makefile                           |  2 +-
 .../patch-libLumina_LuminaOS-FreeBSD.cpp (new)     | 72 ++++++++++++++++++++++
 2 files changed, 73 insertions(+), 1 deletion(-)
Comment 3 Jason W. Bacon freebsd_committer freebsd_triage 2022-02-23 14:47:40 UTC
Patches sent to upstream as well.