set-battery-threshold
This commit is contained in:
parent
76d9e00c77
commit
65b46c7981
1 changed files with 23 additions and 0 deletions
23
.local/bin/set-battery-threshold
Executable file
23
.local/bin/set-battery-threshold
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# https://www.coreboot.org/Board:lenovo/x230
|
||||||
|
|
||||||
|
usage () {
|
||||||
|
echo "usage: $0 start_threshold stop_threshold"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if expr "$1" : '[0-9][0-9]*$'>/dev/null; then
|
||||||
|
start_threshold="$(printf '%x' "$1")"
|
||||||
|
else
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
if expr "$2" : '[0-9][0-9]*$'>/dev/null; then
|
||||||
|
stop_threshold="$(printf '%x' "$2")"
|
||||||
|
else
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
ectool -w 0xb0 -z "$start_threshold"
|
||||||
|
ectool -w 0xb1 -z "$stop_threshold"
|
Loading…
Reference in a new issue