summaryrefslogtreecommitdiff
path: root/widgets/battery.lua
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/battery.lua')
-rw-r--r--widgets/battery.lua35
1 files changed, 22 insertions, 13 deletions
diff --git a/widgets/battery.lua b/widgets/battery.lua
index 873f1ba..1ca7892 100644
--- a/widgets/battery.lua
+++ b/widgets/battery.lua
@@ -5,16 +5,19 @@ local naughty = require("naughty")
-- tooltip text function
local tooltip_text_format = [[
<b>%s (%s)</b>
-Status: %s
-Charge: %.1f%%
-Health: %.1f%%
-Cycle Count: %d
-Rated Capacity: %.0fmAh (%.1fWh)
-Voltage Min: %.1fV
-Voltage Now: %.1fV
-Technology: %s
-Manufacturer: %s
-Serial Number: %s
+Status: %s
+Charge: %.1f%%
+Remaining: %d minutes
+Cycle Count: %d
+Health: %.1f%%
+Design Capacity: %.0fmAh (%.1fWh)
+Actual Capacity: %.0fmAh (%.1fWh)
+Voltage Min: %.1fV
+Voltage Now: %.1fV
+Power Now: %.1fW
+Technology: %s
+Manufacturer: %s
+Serial Number: %s
]]
function bat_uevents()
@@ -35,18 +38,24 @@ function bat_uevents()
if a.TYPE == "Battery" then
local capacity = a.ENERGY_NOW * 100 / a.ENERGY_FULL
local health = a.ENERGY_FULL * 100 / a.ENERGY_FULL_DESIGN
- local mah = a.ENERGY_FULL_DESIGN * 1000 / a.VOLTAGE_MIN_DESIGN
+ 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
text = text .. tooltip_text_format:format(
a.NAME,
a.MODEL_NAME,
a.STATUS,
capacity,
- health,
+ remaining,
a.CYCLE_COUNT,
- mah,
+ health,
+ mah_design,
a.ENERGY_FULL_DESIGN / 1000000,
+ mah_actual,
+ a.ENERGY_FULL / 1000000,
a.VOLTAGE_MIN_DESIGN / 1000000,
a.VOLTAGE_NOW / 1000000,
+ a.POWER_NOW / 1000000,
a.TECHNOLOGY,
a.MANUFACTURER,
a.SERIAL_NUMBER