xbar-plugins icon indicating copy to clipboard operation
xbar-plugins copied to clipboard

No percentage on Catalina

Open Clorr opened this issue 3 years ago • 2 comments

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

Clorr avatar Jan 27 '23 10:01 Clorr

Also little glitch, the o is missing in <xbar.title>Keybard Battery</xbar.title> ;-)

Clorr avatar Jan 27 '23 10:01 Clorr

FAO @matryer ☝🏽

sprak3000 avatar Jan 27 '23 14:01 sprak3000