#!/bin/bash

# Get current brightness percentage
get_brightness() {
    local current=$(brightnessctl get)
    local max=$(brightnessctl max)
    echo $((current * 100 / max))
}

# Output initial brightness
get_brightness

# Monitor brightness changes
inotifywait -m -e modify /sys/class/backlight/*/brightness 2>/dev/null | while read -r; do
    get_brightness
done
