Skip to content

Instantly share code, notes, and snippets.

@redconfetti
Last active March 29, 2024 18:59
Show Gist options
  • Save redconfetti/e9538b36564eea090a3a1b80b6103e83 to your computer and use it in GitHub Desktop.
Save redconfetti/e9538b36564eea090a3a1b80b6103e83 to your computer and use it in GitHub Desktop.
View Battery Level in Clockwork Pi uConsole terminal
#!/bin/bash
BATTERY_DIR="/sys/class/power_supply/axp20x-battery"
echo "$(cat $BATTERY_DIR/capacity)%"
echo "Health: $(cat $BATTERY_DIR/health)%"
echo "Current: $(cat $BATTERY_DIR/current_now)%"
echo "Voltage: $(cat $BATTERY_DIR/voltage_now)%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment