From 0ab4b3a083248e7ed205a1db9939b7622d086ddc Mon Sep 17 00:00:00 2001 From: Steve Schnepp Date: Thu, 3 Sep 2015 17:14:15 +0200 Subject: [PATCH] battery_: make a wildcard plugin --- plugins/sensors/{battery-uevent_ => battery_} | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) rename plugins/sensors/{battery-uevent_ => battery_} (82%) diff --git a/plugins/sensors/battery-uevent_ b/plugins/sensors/battery_ similarity index 82% rename from plugins/sensors/battery-uevent_ rename to plugins/sensors/battery_ index f4cbd541..01f6f9d0 100755 --- a/plugins/sensors/battery-uevent_ +++ b/plugins/sensors/battery_ @@ -1,8 +1,18 @@ #! /bin/sh # Plugin to monitor the battery status via the uevent API +# +# (c) 2015 - GPLv2 - steve.schnepp@pwkf.org +# +# It is a wildcard plugin, symlink it with the battery directory +# default is to display charge as mAh, but you can also use percentage if you +# prefer, by setting the env var "percent" to "yes". +# +# [battery_*] +# env.percent no +# -battery_name=CMB1 -percent=yes +battery_name=${0##*_} +percent=${percent:-"no"} if [ "$1" = "config" ] then