re: Mouse battery
FAO: (@alexandregz)
Hi, After updating to High Sierra I now get these errors:
This is also happing with the "Battery Apple Bluetooth keyboard" plugin
Is there a way to fix this? Thanks.
Hi @migabc
I checked with High Sierra and with Mouse and Keyboard plugins and is fine:
alex@vosjod:~/Development/bitbar/bitbar-plugins/Enabled(master)$ ./keyboard-system_profiler.1m.rb
Keyboard: 4%
alex@vosjod:~/Development/bitbar/bitbar-plugins/Enabled(master)$ ./mouse.1m.sh
Mouse: 41%

I'm using an iMac 27" 2017. It shows the keyboard and mouse battery percentage but it also shows those errors I mentioned above. It was working OK before the upgrade (when I had macOS Sierra)
I was getting the errors too. For keyboard-system_profiler.1m.rb, changing
output = YAML.load(`system_profiler SPBluetoothDataType`);
to
output = YAML.load(`system_profiler SPBluetoothDataType 2>/dev/null`);
resolved the errors.
I tried to make that change but I get a "poxix_spawn: error 1" as soon as I edit the file. I rolled back the change but I still get the same error. I'm using TextEdit (plain Text). Am I missing something?
Edited with vi and now it's OK. The TextEdit even in PlainText mode must be adding some strange chars
Anyway, Problem solved for both keyboard and mouse
Thanks a lot for the tip
👍