#!/bin/bash

get_perc() {
    bash ~/.config/eww/scripts/battery --perc
}

# Output initial state
get_perc

# Monitor battery events using upower
upower --monitor | while read -r line; do
    get_perc
done
