Skip to content

Instantly share code, notes, and snippets.

@matael
Created May 8, 2015 17:46
Show Gist options
  • Save matael/3252240dfb27ae34599b to your computer and use it in GitHub Desktop.
Save matael/3252240dfb27ae34599b to your computer and use it in GitHub Desktop.
Battert
#!/bin/bash
now=`cat /sys/class/power_supply/BAT0/charge_now`;
full=`cat /sys/class/power_supply/BAT0/charge_full`;
echo "Battery charge : $(($now*100/$full))%";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment