summaryrefslogtreecommitdiff
path: root/scripts/battery_level
diff options
context:
space:
mode:
authordavidovki <david@davidovski.xyz>2023-03-01 00:15:29 +0000
committerdavidovki <david@davidovski.xyz>2023-03-01 00:15:29 +0000
commit51292e49bb8092134df6bb1ca586c23bcd2b1ddf (patch)
treec9187f0b7040560666ad6627728aebffa3da6b25 /scripts/battery_level
parent1e137b842f55e37484cf7df0e1fcf11af7280e61 (diff)
Add better laptop support
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