Skip to content

Instantly share code, notes, and snippets.

@ara-ta3
Created January 3, 2023 04:30
Show Gist options
  • Save ara-ta3/5c18765979b5df1f09b2e1616de51e12 to your computer and use it in GitHub Desktop.
Save ara-ta3/5c18765979b5df1f09b2e1616de51e12 to your computer and use it in GitHub Desktop.
#!/bin/bash
SECONDS=`date '+%s'`
NAME='battery.magictrackpad'
VALUE=`ioreg -c AppleDeviceManagementHIDEventService|grep BatteryPercent|awk -F'|' '{print $6}'|awk -F'=' '{print $2}'|xargs echo`
echo -e "${NAME}\t${VALUE}\t${SECONDS}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment