From e0f938bcacae880dd21ffe6dd8578e346ccd8374 Mon Sep 17 00:00:00 2001 From: enkore Date: Tue, 5 Mar 2013 17:29:37 +0100 Subject: [PATCH] README --- README.md | 15 +++++++++++++++ i3pystatus/battery.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 96d5c42..37d1828 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,24 @@ Available formatters: This class uses the /sys/class/power_supply/…/uevent interface to check for the 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`) * `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`) diff --git a/i3pystatus/battery.py b/i3pystatus/battery.py index 90f6fbe..50461bc 100644 --- a/i3pystatus/battery.py +++ b/i3pystatus/battery.py @@ -71,7 +71,7 @@ class BatteryChecker(IntervalModule): alert = False alert_percentage = 10 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): self.base_path = "/sys/class/power_supply/{0}/uevent".format(self.battery_ident)