From 365d0a7c97f3905c16caf70c0bb7ef6054b232f2 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 30 Jun 2019 00:49:00 +0100 Subject: New options -a, -A for low battery notifications --- readme.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'readme.md') diff --git a/readme.md b/readme.md index 2214bda..c8a75e6 100644 --- a/readme.md +++ b/readme.md @@ -898,6 +898,12 @@ specification, such as `("clear", "")`. - `-p`: color to display positive power (battery charging) - `-f`: file in `/sys/class/power_supply` with AC info (default: "AC/online") + - `-A`: a number between 0 and 100, threshold below which the action + given by `-a`, if any, is performed (default: 5) + - `-a`: a string with a system command that is run when the + percentage left in the battery is less or equal than the threshold + given by the `-A` option. If not present, no action is + undertaken. - `--on-icon-pattern`: dynamic string for current battery charge when AC is "on" in `leftipat`. - `--off-icon-pattern`: dynamic string for current battery charge @@ -916,14 +922,18 @@ specification, such as `("clear", "")`. "-L", "10", "-H", "80", "-p", "3", "--", "-O", "On - ", "-i", "", "-L", "-15", "-H", "-5", - "-l", "red", "-m", "blue", "-h", "green"] + "-l", "red", "-m", "blue", "-h", "green" + "-a", "notify-send -u critical 'Battery running out!!'", + "-A", "3"] 600 In the above example, the thresholds before the "--" separator affect only the `` and `` fields, while those after the separator affect how `` is displayed. For this monitor, neither the generic nor the specific options have any effect on - ``. + ``. We are also telling the monitor to execute the unix + command `notify-send` when the percentage left in the battery + reaches 6%. It is also possible to specify template variables in the `-O` and `-o` switches, as in the following example: -- cgit v1.2.3