summaryrefslogtreecommitdiff
path: root/scripts/battery_level
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-03-02 16:03:51 +0000
committerdavidovski <david@davidovski.xyz>2023-03-02 16:03:51 +0000
commitc293e10e512f322af62c55c95fc96231bb3b3b73 (patch)
tree41c4af9449b2bb425f2d65f1ce6d86f1a3f1f731 /scripts/battery_level
parentaf8fa86eb2bb39dd0e793711aede7bec47554b54 (diff)
parent51292e49bb8092134df6bb1ca586c23bcd2b1ddf (diff)
Merge branch 'master' of git.cheetah.remote:dot
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