From 4f8ff86362c45ddc0b291f4f1c19b7b275758de0 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Thu, 17 Sep 2026 17:17:39 -0500 Subject: update battery dropdown with more info betterer --- widgets/battery.lua | 20 +++++++++++++------- 1 file 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 = [[ -%s (%s) +%s (%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 ) -- cgit v1.2.3