GoldenChaos-BTT Support and Feedback Thread

This is awesome! Thanks!

GoldenChaos, excellent work!! Thanks a lot!
I was wondering if there is a way instead of just showing the next event on the touchbar to show all the events of the day. iCalBuddy recommends a way to keep all of the events/tasks in a section (e.g. a single day if separating by date, or a single calendar if separating by calendar) on the same line.

$ icalBuddy -sd -ps "|, |" -ss "\n-------------------------\n" -b "••BULLET•• " eventsToday+20 | perl -e 'while($s = <STDIN>) { $x .= $s; }; $x =~ s/\n((?:\e[[0-9;]m))••BULLET••/$1 •/sg; print $x;'

I tried to combine the above (which runs on the terminal perfectly) with your applescript (by doing some modifications) but could not make it work. Each event was appearing at a separate line because the perl script did not work and touchbar could not show anything. Is there a way to do that? Thank a lot!

@GoldenChaos I noticed my buttons weren't exactly like yours (play button, middle screen alignment button). When I hold control it's the same, out of a four button block, the middle ones have rounded corners (didn't know how to make a screenshot of this :stuck_out_tongue:) Is there something wrong with my settings? It's the GC-BTT 2.543 one.

@vasilismg I don't think there's a way to have it display them in separate buttons, I'm learning more about iCalBuddy doing the expanded reminders widget so I think you'll be able to take code from that to do what you want. Make sure to grab the next experimental release when it's ready :slight_smile:

@negatiev Huh, weird. Those buttons should have a 0 corner radius setting. Do they on your machine?

@GoldenChaos Nope, it had 6px. Also the now playing thing for Spotify and Youtube(chrome), won't work on mine...

Thank you @GoldenChaos. I was meaning to show all the events of the day on the same button. Looking forward to your next release!

Weird, will double check these in the next export. Did anyone else have this issue?

Will also investigate Spotify and Chrome not working, I might've broke them.

@GoldenChaos Buttons are fixed now, wasn't much of a hassle. Are you also running the Mojave beta?

I think the corner thingy is a bug in the alpha :wink:

Finally solved the media player widget hierarchy problem. Next experimental release will not have any of the jumbled mess of if statements that is the current version. Also VLC graduates to a default widget!

Btw. you can now use http://api.folivora.ai/forecast/48.137427,11.607643?units=auto&exclude=minutely,hourly,alerts,flag as url for the weather API (the parameters can be changed the same way as for DarkSky). It has a limit of 50k requests per day.

oh my god I can see the weather again

I'm still only getting a partly sunny icon with no temperature. I think I followed all the suggestions above:
-updated with my DarkSky Key --> then put in the folivora http as well
-installed all the relevant packages
--xcode-select --install
--ruby ...
--easy_install pip
--sudo pip install request
--brew install locateme
-tried changing my python directory

Restarted BTT throughout that. Still I just have an icon. Any suggestions?

Running High Sierra 10.13.6.

The Dark Sky widget only gets 1000 calls a day, and it's out for the day.

Here is the new weather widget script that uses the BTT API instead. It's the same as the Dark Sky one, just using the BTT url (so no API key needed) and it will always work:

# -*- coding: utf-8 -*-
import os
import sys
import requests
sys.tracebacklimit = 0
latLon = os.popen("/usr/local/bin/locateme -f '{LAT},{LON}'").readlines()[0].rstrip()
apiUrl = 'http://api.folivora.ai/forecast/' + latLon + '?units=auto&exclude=minutely,hourly,daily,alerts,flags'
iconDict = {
  'clear-day': "☀️",
  'clear-night': "🌙",
  'partly-cloudy-day': "⛅️",
  'partly-cloudy-night': "⛅️",
  'cloudy': "☁️",
  'rain': "🌧",
  'sleet': "🌨️",
  'fog': "☁️",
  'wind': "🌀",
  'snow': "❄️"
}

try:
  rsp = requests.get(apiUrl).json()
  temperature = rsp['currently']['temperature']
  weatherStatus = rsp['currently']['icon']
  print iconDict[weatherStatus] + " " + str(int(round(temperature))) + "°"
except ValueError:
  print "⛅️"
except ConnectionError:
  print "⛅️"
except error:
  print "⛅️"

Wow! Thanks @GoldenChaos for the quick reply! Also, thanks for all the time you've put into this. It's truly awesome!

I copied in this code and still have the same issue. I also updated your exception codes to see which one was popping, but I still just get the button name which is the :partly_sunny:️icon. For what it's worth, I can change that and see updates.

Any other ideas?

You probably just need to restart BTT. The script is only set to run once every two hours by default, and editing the script doesn’t cause it to run, which is why your changes aren’t reflecting on the Touch Bar.

Tried that. I even tried deleting and reinstalling BTT.

Also, when I click on "Run Script" in the edit dialog, nothing shows up. I was getting errors before installing homebrew and other packages. Now, no errors, but nothing at all.

Can you upload a screenshot of what your weather widget code looks like?

Here's the code copy and pasted (and I attached a screenshot):

-- coding: utf-8 --

import os
import sys
import requests
sys.tracebacklimit = 0
latLon = os.popen("/usr/local/bin/locateme -f '{LAT},{LON}'").readlines()[0].rstrip()
apiUrl = 'http://api.folivora.ai/forecast/' + latLon + '?units=auto&exclude=minutely,hourly,daily,alerts,flags'
iconDict = {
'clear-day': ":sunny:",
'clear-night': ":crescent_moon:",
'partly-cloudy-day': ":partly_sunny:",
'partly-cloudy-night': ":partly_sunny:",
'cloudy': ":cloud:",
'rain': ":cloud_with_rain:",
'sleet': ":cloud_with_snow:",
'fog': ":cloud:",
'wind': ":cyclone:",
'snow': ":snowflake:"
}

try:
rsp = requests.get(apiUrl).json()
temperature = rsp['currently']['temperature']
weatherStatus = rsp['currently']['icon']
print iconDict[weatherStatus] + " " + str(int(round(temperature))) + "°"
except ValueError:
print ":sunny:"
except ConnectionError:
print ":snowflake:"
except error:
print ":cyclone:"

That looks fine to me. Are you on the latest BTT alpha? I honestly can't think what else would be the issue.