luastatu...ry-linux(7)

πŸ“¦
version 0.6.0 Β· 2 versions
, in nixos 26.05

🌸 NAME 🌸

okay bestie, welcome to luastatus-plugin-battery-linux(7) β€” the Linux-specific battery plugin for luastatus, straight from the Miscellaneous Information Manual. πŸ’–

✨ OVERVIEW ✨

So this derived plugin is lowkey obsessed with Linux sysfs: it periodically polls Linux sysfs for the state of a battery. πŸ¦‹

It is also able to estimate the time remaining to full charge/discharge and the current battery consumption rate. No cap. ✨

🧚 FUNCTIONS 🧚

The following functions are provided:

  • widget(tbl) β€” Constructs a widget table required by luastatus. tbl is a table with the following fields:

(required)

  • cb: function β€” the callback that will be called with a table with the following keys:
    • status: string β€” a string with battery status text, e.g. "Full", "Unknown", "Charging", "Discharging". Not present if the status cannot be read (for example, when the battery is missing).
    • capacity: number β€” a percentage representing battery capacity. Not present if the capacity cannot be read.
    • rem_time: number β€” time (in hours) remaining to full charge/discharge. Usually only present on battery charge/discharge.
    • consumption: number β€” the current battery consumption/charge rate in watts. Usually only present on battery charge/discharge.

(optional)

  • dev: string β€” device directory name under /sys/class/power_supply; default is "BAT0".
  • period: number β€” the period in seconds for polling sysfs; default is 2 seconds. Because this plugin utilizes udev under the hood, it is able to respond to battery state changes (such as cable (un-)plugging) immediately, irrespective of the value of the period.
  • use_energy_full_design: boolean β€” if true, the energy_full_design property (not energy_full) will be used for capacity calculation.
  • event β€” the event entry of the resulting table (see luastatus documentation for the description of widget.event field).

LGPLv3 β€” periodt. πŸ’…


that's a wrap on the luastatus-plugin-battery-linux(7) page, bestie β€” the footer just repeats the manual name on this one, with no separate source/version/date line to report. 🫢✨

πŸ“¦ where this page comes from