#!/bin/bash

get_time() {
    acpi -b | grep -oP '\d{2}:\d{2}:\d{2}' || echo "Calculating..."
}

# Output initial state
get_time

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