lain/bat.md

27 lines
698 B
Markdown
Raw Normal View History

2013-09-07 14:35:22 +02:00
[<- widgets](https://github.com/copycat-killer/lain/wiki/Widgets)
2013-09-07 14:13:26 +02:00
Shows in a textbox the remaining time and percentage capacity of your laptop battery, as well as
2013-09-07 12:34:00 +02:00
the current wattage.
Displays a notification when battery is low or critical.
mybattery = lain.widgets.bat()
2013-09-10 22:32:32 +02:00
### input table
2013-09-07 12:34:00 +02:00
Variable | Meaning | Type | Default
--- | --- | --- | ---
2013-09-10 22:32:32 +02:00
`timeout` | Refresh timeout seconds | int | 30
2013-09-07 12:34:00 +02:00
`battery` | Identifier of the battery | string | "BAT0"
2013-09-10 22:32:32 +02:00
`settings` | User settings | function | empty function
2013-09-09 13:59:05 +02:00
2013-09-12 21:34:21 +02:00
`settings` can use the `bat_now` table, which contains the following strings:
- `status` ("Not present", "Charging", "Discharging");
2013-09-12 21:34:40 +02:00
- `perc`;
2013-09-12 21:34:21 +02:00
- `time`;
- `watt`.
2013-09-10 22:46:24 +02:00
2013-09-10 22:32:32 +02:00
### output
A textbox.