From 90460d94cece864874e6e96a25398600d90f7b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B3=D0=BE=D1=80?= Date: Sat, 8 Dec 2018 18:36:46 +0300 Subject: [PATCH] Abridge levels description, add example instead (#683) fixes issue #681 --- i3pystatus/battery.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/i3pystatus/battery.py b/i3pystatus/battery.py index 16a3740..75c4d40 100644 --- a/i3pystatus/battery.py +++ b/i3pystatus/battery.py @@ -162,7 +162,7 @@ class BatteryChecker(IntervalModule): format='{battery_ident}: [{status} ]{percentage_design:.2f}%', alert=True, alert_percentage=15, - status = { + status={ 'DPL': 'DPL', 'CHR': 'CHR', 'DIS': 'DIS', @@ -170,6 +170,16 @@ class BatteryChecker(IntervalModule): } ) + # status.register( + # 'battery', + # format='{status} {percentage:.0f}%', + # levels={ + # 25: "<=25", + # 50: "<=50", + # 75: "<=75", + # }, + # ) + status.run() """ @@ -189,15 +199,7 @@ class BatteryChecker(IntervalModule): ("base_path", "Override the default base path for searching for batteries"), ("battery_prefix", "Override the default battery prefix"), ("status", "A dictionary mapping ('DPL', 'DIS', 'CHR', 'FULL') to alternative names"), - ("levels", - "A dictionary mapping of charge levels to corresponding names. Let the keys be a < b < c < d. " - "Then the following intervals correspond to each value:\n" - " 0 -> status['DPL']\n" - " |0 < x <= a| -> levels[a]\n" - " |a < x <= b| -> levels[b]\n" - " |b < x <= c| -> levels[c]\n" - " |c < x <= d| -> levels[d]\n" - " |d < x <= 100| -> status['FULL']"), + ("levels", "A dictionary mapping percentages of charge levels to corresponding names."), ("color", "The text color"), ("full_color", "The full color"), ("charging_color", "The charging color"),