Skip to content

Instantly share code, notes, and snippets.

/gist:9135844
Created Feb 21, 2014

Embed
What would you like to do?
#!/usr/bin/perl -w
$mouseLevel=`ioreg -n "BNBMouseDevice" | grep -i "batterypercent"`;
chomp ($mouseLevel);
$mouseLength=length ($mouseLevel);
$mouseLevel=substr($mouseLevel,($mouseLength-2),3);
print "<result>$mouseLevel</result>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.