summaryrefslogtreecommitdiffstats
path: root/.local/bin/statusbar/battery
diff options
context:
space:
mode:
authorKawaiiAmber <japaneselearning101@gmail.com>2020-12-15 14:01:53 -0700
committerKawaiiAmber <japaneselearning101@gmail.com>2020-12-15 14:01:53 -0700
commit2548c0bc2046dbd8910f2ab74291a3537598fc66 (patch)
treec1222a887ca1d89997c354ebc9dbcf12d622474f /.local/bin/statusbar/battery
parentc3e3dd737adb6b29ab1bcf28080ee5383c9f206a (diff)
downloadeibhear-2548c0bc2046dbd8910f2ab74291a3537598fc66.tar.gz
eibhear-2548c0bc2046dbd8910f2ab74291a3537598fc66.tar.zst
eibhear-2548c0bc2046dbd8910f2ab74291a3537598fc66.zip
No longer calls cat twice
Diffstat (limited to '.local/bin/statusbar/battery')
-rwxr-xr-x.local/bin/statusbar/battery4
1 files changed, 2 insertions, 2 deletions
diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery
index c778ec4..48df164 100755
--- a/.local/bin/statusbar/battery
+++ b/.local/bin/statusbar/battery
@@ -25,8 +25,6 @@ esac
# Defines the formatting for the info from the battery folders
format()
{
- # Will make a warn variable if discharging and low
- [ $(cat "$1/status") = "[Dd]ischarging" ] && [ $(cat "$1/capacity") -le 25 ] && local warn="❗ "
# Sets up the status and capacity
status=$(cat "$1/status")
case "$status" in
@@ -44,6 +42,8 @@ format()
;;
esac
capacity=$(cat "$1/capacity")
+ # Will make a warn variable if discharging and low
+ [ "$status" = "🔋 " ] && [ "$capacity" -le 25 ] && local warn="❗ "
# Prints the info
printf "%s%s%d%%\n" "$status" "$warn" "$capacity"
}