luastatu...ry-linux(7)
πΈ 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 byluastatus.tblis 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 is2seconds. Because this plugin utilizesudevunder the hood, it is able to respond to battery state changes (such as cable (un-)plugging) immediately, irrespective of the value of theperiod.use_energy_full_design: boolean β if true, theenergy_full_designproperty (notenergy_full) will be used for capacity calculation.eventβ the event entry of the resulting table (seeluastatusdocumentation for the description ofwidget.eventfield).
Β©οΈ COPYRIGHT Β©οΈ
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
- nixos 26.05: luastatus 0.6.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms