Created
May 11, 2017 02:48
-
-
Save xtacocorex/40a5f7bd7de5c1633aeb6db01db7b6ba to your computer and use it in GitHub Desktop.
zwack's battery monitor for the chip so bigbadhodad can download it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
FUEL=$((`/usr/sbin/i2cget -y -f 0 0x34 0xb9`)) | |
if [ $FUEL -lt 15 ] | |
then | |
echo "default-on" > /sys/class/leds/chip\:white\:status/trigger | |
elif [ $FUEL -eq 127 ] | |
then | |
echo "flash" > /sys/class/leds/chip\:white\:status/trigger | |
else | |
echo "none" > /sys/class/leds/chip\:white\:status/trigger | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment