Notes & TILs
Search…
Check battery status
Posted on 11 Sep, 2021

Linux

1
upower -i /org/freedesktop/UPower/devices/battery_BAT0 | awk '/percentage/ {print $2}'
Copied!

MacOS

1
pmset -g batt | awk '/discharging/ {print $3}' | tr -d ";"
Copied!
Last modified 1mo ago
Copy link
Contents
Linux
MacOS