Created
July 17, 2016 14:37
-
-
Save Slowhand0309/bf5f504f8d5a6c7b5b78103bb37b0d3b to your computer and use it in GitHub Desktop.
Get battery percent of mouse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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