copycat-killer/lain — pull request #5 by cahna (2013-09-26 05:51:38+00:00)
Title: ThinkPad Battery Widget

A battery widget that works with Lenovo ThinkPad laptops using tp_smapi. Includes hover notification with more details. Configuration is identical to main bat widget's:

```Lua
-- Battery
baticon = wibox.widget.imagebox(beautiful.widget_batt)
batwidget = lain.widgets.contrib.tpbat({ -- Use contrib.tpbat
settings = function()
if bat_now.perc == "N/A" then
bat_now.perc = "AC "
else
bat_now.perc = bat_now.perc .. "% "
end
widget:set_text(bat_now.perc)
end
})
```

I can provide screenshots, if needed, and a wiki entry. Let me know your thoughts. (tpbat.lua line 20 is a bit ugly)