diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2026-09-17 17:17:39 -0500 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2026-09-17 17:17:39 -0500 |
| commit | 4f8ff86362c45ddc0b291f4f1c19b7b275758de0 (patch) | |
| tree | be8ffde181a98ca55e0804b3a33ca8d1d1fc9fc4 | |
| parent | b957010dc2e219332b57284b5d073467235c5739 (diff) | |
| download | awesome-4f8ff86362c45ddc0b291f4f1c19b7b275758de0.tar.xz awesome-4f8ff86362c45ddc0b291f4f1c19b7b275758de0.zip | |
| -rw-r--r-- | widgets/battery.lua | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/widgets/battery.lua b/widgets/battery.lua index 1ca7892..32d8f66 100644 --- a/widgets/battery.lua +++ b/widgets/battery.lua @@ -4,18 +4,20 @@ local naughty = require("naughty") -- tooltip text function local tooltip_text_format = [[ -<b>%s (%s)</b> +<b>%s</b> (%s) Status: %s -Charge: %.1f%% +Charge: %.2f%% +Energy Now: %.0fmAh (%.1fWh) Remaining: %d minutes Cycle Count: %d -Health: %.1f%% +Health: %.2f%% Design Capacity: %.0fmAh (%.1fWh) Actual Capacity: %.0fmAh (%.1fWh) -Voltage Min: %.1fV -Voltage Now: %.1fV -Power Now: %.1fW +Voltage Min: %.2fV +Voltage Now: %.2fV +Power Now: %.2fW Technology: %s +Model Name: %s Manufacturer: %s Serial Number: %s ]] @@ -41,11 +43,14 @@ function bat_uevents() local remaining = a.ENERGY_NOW * 60 / a.POWER_NOW local mah_design = a.ENERGY_FULL_DESIGN * 1000 / a.VOLTAGE_MIN_DESIGN local mah_actual = a.ENERGY_FULL * 1000 / a.VOLTAGE_MIN_DESIGN + local mah_now = a.ENERGY_NOW * 1000 / a.VOLTAGE_MIN_DESIGN text = text .. tooltip_text_format:format( a.NAME, - a.MODEL_NAME, + a.CAPACITY_LEVEL, a.STATUS, capacity, + mah_now, + a.ENERGY_NOW / 1000000, remaining, a.CYCLE_COUNT, health, @@ -57,6 +62,7 @@ function bat_uevents() a.VOLTAGE_NOW / 1000000, a.POWER_NOW / 1000000, a.TECHNOLOGY, + a.MODEL_NAME, a.MANUFACTURER, a.SERIAL_NUMBER ) |
