aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-05-12 17:52:03 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-05-12 17:52:03 -0300
commite068c9d22eb6442dc3d41872ff4bc6d153fbf8b8 (patch)
tree71c980dabc0d1fb518d40ad4e11733c21292621a
parent06887fc003755e2bdae34cb685acf285db22c6a9 (diff)
downloadscripts-e068c9d22eb6442dc3d41872ff4bc6d153fbf8b8.tar.gz
scripts-e068c9d22eb6442dc3d41872ff4bc6d153fbf8b8.tar.bz2
Improving limbat
-rwxr-xr-xlimbat15
1 files changed, 11 insertions, 4 deletions
diff --git a/limbat b/limbat
index 5541d05..c3489f7 100755
--- a/limbat
+++ b/limbat
@@ -1,4 +1,8 @@
#!/bin/sh
+#
+# See http://www.thinkwiki.org/wiki/Battery
+# http://www.thinkwiki.org/wiki/Tp_smapi
+#
function usage() {
echo "Usage: ${0} [--help | option]"
@@ -29,18 +33,21 @@ if [ "${1}" != "" ]; then
action=${1}
fi
+# battery interface location
+BAT="/sys/devices/platform/smapi/BAT0"
+
function show_thresholds() {
echo -n "Low threshold: "
- cat /sys/devices/platform/smapi/BAT0/start_charge_thresh
+ cat $BAT/start_charge_thresh
echo -n "High threshold: "
- cat /sys/devices/platform/smapi/BAT0/stop_charge_thresh
+ cat $BAT/stop_charge_thresh
}
function set_thresholds() {
START_THRESH=${1}
STOP_THRESH=${2}
- sudo sh -c "echo ${START_THRESH} > /sys/devices/platform/smapi/BAT0/start_charge_thresh"
- sudo sh -c "echo ${STOP_THRESH} > /sys/devices/platform/smapi/BAT0/stop_charge_thresh"
+ sudo sh -c "echo ${START_THRESH} > $BAT/start_charge_thresh"
+ sudo sh -c "echo ${STOP_THRESH} > $BAT/stop_charge_thresh"
}
# do your thang