diff options
Diffstat (limited to 'dot_config/i3/scripts/executable_battery-pinebook-pro')
-rw-r--r-- | dot_config/i3/scripts/executable_battery-pinebook-pro | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dot_config/i3/scripts/executable_battery-pinebook-pro b/dot_config/i3/scripts/executable_battery-pinebook-pro new file mode 100644 index 0000000..fd97370 --- /dev/null +++ b/dot_config/i3/scripts/executable_battery-pinebook-pro | |||
@@ -0,0 +1,18 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | #simple Shellscript for i3blocks on Pinebook pro | ||
3 | #05012020 [email protected] Gerhard S. | ||
4 | #battery-symbols: on Manjaro you need the awesome-terminal-fonts package installed! | ||
5 | PERCENT=$(cat /sys/class/power_supply/cw2015-battery/capacity) | ||
6 | STATUS=$(cat /sys/class/power_supply/cw2015-battery/status) | ||
7 | case $(( | ||
8 | $PERCENT >= 0 && $PERCENT <= 20 ? 1 : | ||
9 | $PERCENT > 20 && $PERCENT <= 40 ? 2 : | ||
10 | $PERCENT > 40 && $PERCENT <= 60 ? 3 : | ||
11 | $PERCENT > 60 && $PERCENT <= 80 ? 4 : 5)) in | ||
12 | # | ||
13 | (1) echo $STATUS:"" :$PERCENT%;; | ||
14 | (2) echo $STATUS:"" :$PERCENT%;; | ||
15 | (3) echo $STATUS:"" :$PERCENT%;; | ||
16 | (4) echo $STATUS:"" :$PERCENT%;; | ||
17 | (5) echo $STATUS:"" :$PERCENT%;; | ||
18 | esac | ||