summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorShubham Saini <pryr@pryr.xyz>2021-05-12 12:53:13 +0000
committerShubham Saini <pryr@pryr.xyz>2021-05-12 12:53:13 +0000
commit270398eb68c82701e0f1b6fa388ec180f0635bbe (patch)
tree0465029869e2d260d9b6897d01b831816e00ecb9 /bin
parent0b2a271f0bf57925b2b4b04fb3f35c929c3df8ba (diff)
added bat for work machine
Diffstat (limited to 'bin')
-rwxr-xr-xbin/.bin/bat12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/.bin/bat b/bin/.bin/bat
new file mode 100755
index 0000000..473c7e2
--- /dev/null
+++ b/bin/.bin/bat
@@ -0,0 +1,12 @@
1#!/bin/bash
2while true
3do
4 battery_level=$(cat /sys/class/power_supply/BAT0/capacity)
5 state=$(cat /sys/class/power_supply/BAT0/status)
6 if [ $state == "Charging" ]; then
7 echo -e +$battery_level%
8 else
9 echo -e $battery_level%
10 fi
11 sleep 3
12done