aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts/status/battery
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts/.local/scripts/status/battery')
-rwxr-xr-xScripts/.local/scripts/status/battery25
1 files changed, 25 insertions, 0 deletions
diff --git a/Scripts/.local/scripts/status/battery b/Scripts/.local/scripts/status/battery
new file mode 100755
index 0000000..7680ac5
--- /dev/null
+++ b/Scripts/.local/scripts/status/battery
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+capacity=$(cat /sys/class/power_supply/BAT0/capacity) || break
+status=$(cat /sys/class/power_supply/BAT0/status)
+
+if [[ $status == "Charging" ]]
+then
+ status=""
+else
+ if [[ $capacity -ge 75 ]]
+ then
+ status=""
+ elif [[ $capacity -ge 50 ]]
+ then
+ status=""
+ elif [[ $capacity -ge 25 ]]
+ then
+ status=""
+ elif [[ $capacity -ge 10 ]]
+ then
+ status=""
+ else
+ status=""
+ fi
+fi
+echo "$status $capacity%"