xbar-plugins
xbar-plugins copied to clipboard
No percentage on Catalina
Hi !
Thanks to this plugin that let me monitor my keyboard status. He's a little old and doesn't hold so much, so I needed this ;-)
However on Catalina, I had to add the -l flag in addition to the sell command, like this :
#!/bin/sh
# <xbar.title>Keybard Battery</xbar.title>
# <xbar.author>Mat Ryer</xbar.author>
# <xbar.author.github>matryer</xbar.author.github>
PERCENTAGE=$(ioreg -l -c AppleBluetoothHIDKeyboard | grep BatteryPercent | fgrep -v \{ | sed 's/[^[:digit:]]//g')
if [ "$PERCENTAGE" ]; then
echo "KB: $PERCENTAGE%"
else
echo "KB: ?%"
fi
Also little glitch, the o is missing in <xbar.title>Keybard Battery</xbar.title> ;-)
FAO @matryer ☝🏽