#!/bin/bash

# 獲取目前亮度百分比
get_brightness() {
    brightnessctl -m | awk -F, '{print substr($4, 0, length($4)-1)}'
}

case $1 in
    get)
        get_brightness
        ;;
    icon)
        BR=$(get_brightness)
        if [ "$BR" -gt 66 ]; then echo "☀️";
        elif [ "$BR" -gt 33 ]; then echo "🌤️";
        else echo "🔅"; fi
        ;;
esac
