set-battery-threshold: Usar APIs de Linux
Ahora uso un coreboot actualizado que soporta las APIs nativas
This commit is contained in:
parent
ff41a90af1
commit
ed6280329b
1 changed files with 8 additions and 4 deletions
|
@ -8,16 +8,20 @@ usage () {
|
||||||
}
|
}
|
||||||
|
|
||||||
if expr "$1" : '[0-9][0-9]*$'>/dev/null; then
|
if expr "$1" : '[0-9][0-9]*$'>/dev/null; then
|
||||||
start_threshold="$(printf '%x' "$1")"
|
# start_threshold="$(printf '%x' "$1")"
|
||||||
|
start_threshold="$1"
|
||||||
else
|
else
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if expr "$2" : '[0-9][0-9]*$'>/dev/null; then
|
if expr "$2" : '[0-9][0-9]*$'>/dev/null; then
|
||||||
stop_threshold="$(printf '%x' "$2")"
|
# stop_threshold="$(printf '%x' "$2")"
|
||||||
|
stop_threshold="$2"
|
||||||
else
|
else
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ectool -w 0xb0 -z "$start_threshold"
|
# ectool -w 0xb0 -z "$start_threshold"
|
||||||
ectool -w 0xb1 -z "$stop_threshold"
|
# ectool -w 0xb1 -z "$stop_threshold"
|
||||||
|
echo "$start_threshold" > /sys/class/power_supply/BAT0/charge_control_start_threshold
|
||||||
|
echo "$stop_threshold" > /sys/class/power_supply/BAT0/charge_control_end_threshold
|
||||||
|
|
Loading…
Reference in a new issue