summaryrefslogtreecommitdiff
path: root/battery.sh
diff options
context:
space:
mode:
authorMichaël Ball <git@michaelball.name>2021-02-21 11:57:10 +0000
committerMichaël Ball <git@michaelball.name>2021-02-21 11:57:10 +0000
commit6cd46646d6f6e77cabf4969b1455e2bdf9dce24a (patch)
treea12d8190d87c1c268e385ec42e40cf516d58908c /battery.sh
parent3de82782746019f605456d57226815eb9aac8369 (diff)
Changes for desktopdesktop
Diffstat (limited to 'battery.sh')
-rwxr-xr-xbattery.sh29
1 files changed, 0 insertions, 29 deletions
diff --git a/battery.sh b/battery.sh
deleted file mode 100755
index 78fb773..0000000
--- a/battery.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-
-i3status -c $HOME/.config/i3blocks/i3status.conf | while IFS= read -r line; do
- PARTS=($line)
-
- CHARGE="${PARTS[1]}"
- CHARGE="${CHARGE%\%*}"
- [[ "${CHARGE}" -gt 100 ]] && {
- CHARGE="100"
- }
-
- STATE=""
- [[ "${PARTS[0]}" = "BAT" ]] && {
- STATE="${PARTS[2]}"
- [[ -n "${STATE}" ]] && {
- STATE="${STATE:0:-3}"
- STATE=" (${STATE})"
- }
- }
-
- LEVEL=$(( (CHARGE - 1) / 20 ))
- ICON="f$(( 244 - LEVEL ))"
-
- echo -e "\u${ICON} ${CHARGE}%${STATE} "
-
- [[ "${LEVEL}" = "0" ]] && {
- [[ -z "${STATE}" ]] || i3-msg "fullscreen disable" >/dev/null
- }
-done