Battery TouchBar widget doesn't work. Only shows ???

I am running latest version of BTT with macOS version 10.14.6

The touchbar shows this:

On this widget with these settings:

I don't know why it can't fetch the batter or why ?? is there. Perhaps a font issue?

Usually it shows the question marks for a short time while the system is still calculating the remaining time, how long have you been on battery power?

Been like that for over 5 minutes. Going to wait a bit more but this can't be good.

I moved away from a widget I used that called this applescript:

set theList to paragraphs of text of (do shell script "pmset -g batt")

set percent to word 6 of theList's item 2

set state to word 7 of theList's item 2 as string

if (percent as integer) < 100 or state is "discharging" then

if state is in ["charging", "finishing charge", "charged"] then

return percent & "%"

else if state is "discharging" then

return percent & "%"

else

end if

end if

return ""

And that worked well. The official widget gives me ??

Oh ok nice. It finished and shows the percentage.

Weird, it should be pretty fast.

Do you know whether pmset -g batt also return an estimated time or just the percentage? I'll have to check the logic again but possibly BTT waits until the estimation is complete. If that's true I'll change it for widgets that just show the percentage and not the time.

Never used pmset so don't know.

Ah I thought you might have created the apple script above which calls pmset to get its data.

Didn't want to start new thread.

But could you possibly add an option to not show 0 in beginning of percentage. i.e. it shows 09% now and not 9%. It's a bit strange it does that, I'd love for it to just show the percent number left. So it's clean.

Thank you.

Also to add, it feels super off to me as I see two numbers and think I have more percentage than I do. Seeing just one number makes me quickly get that battery is dying.

Uh yes, the leading zero is weird. I'll check what's causing it. Thanks for letting me know!

1 Like

It's stuck showing 20:00 for the remaining time for me. I've tried restarting BTT and recreating the widget, but nothing changes. :man_shrugging:

What does the terminal command
pmset -g batt show on your machine?

Ahh, It must have been a system error, that command said the same thing and fixed itself after I plugged and unplugged my computer. Thanks for the reply!

1 Like