dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 3f20263444539b59a54fc43f027e2c39d0b5e69a
parent d0b37d460035c36de52eac41e1b8e9f9b1a90730
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Mon,  4 May 2020 13:06:29 -0400

some systems use only lowercase? acpi option added

Diffstat:
M.local/bin/statusbar/battery | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.local/bin/statusbar/battery b/.local/bin/statusbar/battery @@ -12,12 +12,15 @@ case $BLOCK_BUTTON in ❗: battery very low!" ;; esac +# acpi alternative +# acpi | sed "s/Battery [0-9]: //;s/[Dd]ischarging, /🔋/;s/[Nn]ot charging, /🛑/;s/[Cc]harging, /🔌/;s/[Uu]nknown, /♻️/;s/[Ff]ull, /⚡/;s/ \(remaining\|until charged\)//"; exit + # Loop through all attached batteries. for battery in /sys/class/power_supply/BAT? do # Get its remaining capacity and charge status. capacity=$(cat "$battery"/capacity) || break - status=$(sed "s/Discharging/🔋/;s/Not charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/" "$battery"/status) + status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/⚡/" "$battery"/status) # If it is discharging and 25% or less, we will add a ❗ as a warning. [ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗"