Skip to content

Instantly share code, notes, and snippets.

@xtacocorex
Created May 11, 2017 02:48
Show Gist options
  • Save xtacocorex/40a5f7bd7de5c1633aeb6db01db7b6ba to your computer and use it in GitHub Desktop.
Save xtacocorex/40a5f7bd7de5c1633aeb6db01db7b6ba to your computer and use it in GitHub Desktop.
zwack's battery monitor for the chip so bigbadhodad can download it
#! /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