Skip to content

Instantly share code, notes, and snippets.

@Slowhand0309
Created July 17, 2016 14:37
Show Gist options
  • Save Slowhand0309/bf5f504f8d5a6c7b5b78103bb37b0d3b to your computer and use it in GitHub Desktop.
Save Slowhand0309/bf5f504f8d5a6c7b5b78103bb37b0d3b to your computer and use it in GitHub Desktop.
Get battery percent of mouse
#!/usr/bin/env bash
# Mouse
ioreg -c BNBMouseDevice | grep BatteryPercent | grep -v { | sed 's/[^[:digit:]]//g'
# Keyboard
ioreg -c AppleBluetoothHIDKeyboard | grep BatteryPercent | grep -v { | sed 's/[^[:digit:]]//g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment