Query Mac laptop battery information using the pmset command.
pmset -g batt | grep -E "([0-9]+%)"
Returns battery percentage, charging state, and time remaining:
🔋 79%; charging; 0:47 remaining
Respond to user with the battery info in a friendly format with emoji.
共 1 个版本