Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AC/battery detection logic on FreeBSD. #1972

Merged
merged 3 commits into from
Jun 15, 2024

Commits on Jun 13, 2024

  1. Fix AC/battery logic on FreeBSD.

    The logic for the detection of the battery/AC line was not completely correct
    for FreeBSD. Launching conky on console shows the following:
    
    Cannot read sysctl "hw.acpi.battery.time"
    Cannot read sysctl "hw.acpi.battery.life"
    Cannot read sysctl "hw.acpi.battery.state"
    Cannot read sysctl "hw.acpi.acline"
    Unknown battery state 8!
    
    In a PC, the hw.acpi.battery MIB does not exist.
    Also, the hw.acpi.acline is only present if supported by the hardware.
    In addition, some variables were used uninitialized and that causes strange
    behavior: in a PC it showed it worked on battery and the % of charge was an
    ridiculous big number.
    
    This patch addresses the issue. It fixes the problem in the PC. It has also
    being tested in a laptop running FreeBSD current plugin and unplugging the AC
    line and also snatching the battery mercilessly to see if something breaks.
    fernape committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    6dbfb0c View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2024

  1. Configuration menu
    Copy the full SHA
    cba8ad8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f1f9c41 View commit details
    Browse the repository at this point in the history