summaryrefslogtreecommitdiff
path: root/scripts/battery_level
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/battery_level')
-rwxr-xr-xscripts/battery_level4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/battery_level b/scripts/battery_level
new file mode 100755
index 0000000..7bc27d1
--- /dev/null
+++ b/scripts/battery_level
@@ -0,0 +1,4 @@
+#!/bin/sh
+full=$(cat /sys/class/power_supply/BAT0/charge_now)
+now=$(cat /sys/class/power_supply/BAT0/charge_full)
+echo $full / $now \* 100 | bc -l