Created
February 7, 2012 00:00
-
-
Save dgeske/1756022 to your computer and use it in GitHub Desktop.
GeekTool Bluetooth Keyboard and Magic Mouse Battery Status
This file contains 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
kbatt=`ioreg -c AppleBluetoothHIDKeyboard | grep BatteryPercent | awk -F"=" {'print $2'}` && | |
if [ ${#kbatt} -gt 0 ]; then echo "Bluetooth Keyboard: $kbatt%"; fi && | |
tbatt=`ioreg -c BNBTrackpadDevice | grep BatteryPercent | tail -1 | awk -F"=" {'print $2'}` && | |
if [ ${#tbatt} -gt 0 ]; then echo "Magic Trackpad Battery: $tbatt%"; fi && | |
mbatt=`ioreg -c BNBMouseDevice | grep BatteryPercent | tail -1 | awk -F"=" {'print $2'}` && | |
if [ ${#mbatt} -gt 0 ]; then echo "Mouse Battery: $mbatt %"; fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment