This commit is contained in:
enkore 2013-03-05 17:29:37 +01:00
parent 8ebca17e79
commit e0f938bcac
2 changed files with 16 additions and 1 deletions

View File

@ -87,9 +87,24 @@ Available formatters:
This class uses the /sys/class/power_supply/…/uevent interface to check for the This class uses the /sys/class/power_supply/…/uevent interface to check for the
battery status battery status
Available formatters for format and alert_format_\*:
* remaining_str
* remaining_hm
* percentage
* percentage_design
* consumption (Watts)
* status
* battery_ident
* `battery_ident` — (default: `BAT0`) * `battery_ident` — (default: `BAT0`)
* `format` — (default: `{status} {remaining}`) * `format` — (default: `{status} {remaining}`)
* `alert` — Display a libnotify-notification on low battery (default: `False`)
* `alert_percentage` — (default: `10`)
* `alert_format_title` — (default: `Low battery`)
* `alert_format_body` — (default: `Battery {battery_ident} has only {percentage:.2f}% ({remaining_hm}) remaining!`)
* `alert_percentage` — (default: `10`)

View File

@ -71,7 +71,7 @@ class BatteryChecker(IntervalModule):
alert = False alert = False
alert_percentage = 10 alert_percentage = 10
alert_format_title = "Low battery" alert_format_title = "Low battery"
alert_format_body = "Battery {battery_ident} has only {percentage} % ({remaining_hm}) remaining!" alert_format_body = "Battery {battery_ident} has only {percentage:.2f}% ({remaining_hm}) remaining!"
def init(self): def init(self):
self.base_path = "/sys/class/power_supply/{0}/uevent".format(self.battery_ident) self.base_path = "/sys/class/power_supply/{0}/uevent".format(self.battery_ident)