GoldenChaos-BTT Support and Feedback Thread

feature-request
bug

#1021

Yeah, you're not the only one with this issue - for some, I think reinstalling icalBuddy has fixed it. But nobody's been able to find a solution and I've been unable to reproduce the issue :confused: if you manage to fix it, please let me know what you did so I can add that info to the first post. The same goes for anyone else who's had this issue, btw.

@kurktchiev my only recommendation is to wipe and start from scratch; fresh BTT, fresh GC-BTT.


#1022

Hi everyone, got my new TouchBar MacBook last week, found this preset and since then I've been modding, adjusting and fine tuning this wonderful piece of work to my needs. Thanks a bunch @GoldenChaos!

I got a question though: for the life of me I can't get the Reminder and Calendar Widget to show up in my TouchBar. iCalBuddy is installed an I tried getting my appointments via the terminal. What I got is the following:

Summary
icalbuddy eventsToday
2018-09-28 19:40:48.370 icalbuddy[1138:49009] Error loading /System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation:  dlopen(/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation, 265): no suitable image found.  Did find:
	/System/Library/PrivateFrameworks/CalendarFoundation.framework/CalendarFoundation: mach-o, but wrong architecture
	/System/Library/PrivateFrameworks/CalendarFoundation.framework/Versions/A/CalendarFoundation: mach-o, but wrong architecture

After that they do show up but maybe that's a possible reason for the widgets not showing up? Does anyone have an idea?


#1023

Hmm, I think I am beginning to sense a trend. :stuck_out_tongue_closed_eyes:

At least that's some more info than anyone else has found. I'm still not sure how to fix it, though.

@Andreas_Hegenberg any eta on that native cal/reminders widget?


#1024

Unfortunately no eta yet.
However for the iCalBuddy issue try the latest alpha, I think the fix discussed here may be relevant: Not asking for Calendar permissions when running icalBuddy in BTT on Mojave


#1025

I fixed that by uninstalling ical buddy and then installing it using homebrew. fixed that specific error, did not fix the touchbar issue.


#1026

I can confirm that the alpha release fixed the issue!


#1027

I found something weird with the Script:Previous, Script:Pause and Script:Next widgets. After I quicklook some mp4 files, the widgets does not quit itself as the settings said. It persists in the touch bar with three icons(back/play/forward) and a pause button.
Is that a bug or should I change some settings? @Andreas_Hegenberg


#1028

Had a quick glance at the Alpha updated and Reminders show up now as well as Events if I long press the Date-Widget. Thank you very much @thesleepguy and @Andreas_Hegenberg!


#1029

Let me know if you find one. I can't really find a good free one that has supported all those cool features


#1030

@Andreas_Hegenberg Can the emoji widget have categories to make searching through them easier?


#1031

Great work and thank you, I've been playing with the touchbar now for a month and love it.
I've just bought some bluetooth headphones and would love some functionality similar to the BEATS setting. Would I be able to alter the script (bear in mind I have ZERO experience of this) to reflect a different brand of hedphones? Ta Joe


#1032

I've been getting those errors on iCalBuddy as well but it hasn't affected the results that I get and I am able to see calendar entries in the TB. I've also upgraded to Mojave and have no issues with this script (other than thes errors in the terminal.

I've actually been playing with the applescripts quite a lot for the calendar widget and the 10 events in the drill down menu.

I have modified things to:

For the calendar widget:

  • only read calendar entries for a specific calendar (I am syncing colleagues calendars from google apps and was getting their events as well) - this is an icalbuddy switch
  • filter out all day events
  • change the background colour in the TB to RED within 15 mins of a meeting starting
  • continue to show a meeting for 5 mins into the meeting starting (I'm sometimes late...)
  • indicate if there are multiple meetings starting at the next event time (in case I'm double/tripple booked)
  • on the calendar widget indicate how long before the next meeting rather than the start time (eg 1h20m) and include the location
  • show if there are no more events "today"

For the 10 next events when drilling down

  • I found that these weren't updating if new events came into my calendar so:
  • changed these to update on display (BTT setting)
  • changed their apple scripts to read persistent string variables for each of the next 10 events
  • updated the main calendar script to update these 10 variables every time it runs (so that they are no more than 60 seconds out of date - this is done with 1 call to iCalBuddy, not 10 so it's much quicker to display the 10 events on drill down, although it's reading every minute so uses more resources but doesn't seem significant in activity monitor)

For example, this is the script for event 1 in the drill down:

tell application "BetterTouchTool"

return get_string_variable "event1"

end tell

I'm not sure how to post my main apple script to this forum :man_facepalming: (and I was just learning apple script with this attempt so it can probably do with some refactoring and I had to handle the "no more events" with an error trap due to the above mentioned iCalBuddy stderr message causing the applescript to error if there was no text returned).
Am also not sure how we can incorporate the text string variable for the specific calendar into the GC-BTT variables easily?

deep breath

So. If this is of interest, I can tidy up (a bit), anonymise (remove my email address) and post the script for critique, incorporation, ...


#1033

Yes pretty please!! :smile::smile::smile: this sounds awesome, esp since iCalbuddy issues have been fixed up and I can rely on it somewhat.

@joe1978 you can copy the beats script and edit its two components to change the names of what it looks for! I’m on the road so can’t post detailed instructions right now but if you skim through the code of the beats button it’s (hopefully) pretty obvious where it’s checking for device names. :slight_smile:


#1034

GC-BTT and BTT are awesome :smile: and I'm enjoying playing with them a lot.

Hope that this helps.

Calendar widget applescript
-- to do
-- # fix last meeting of the day so it goes away after x mins


set maxSize to 50 -- truncates the meeting name to this length

set calname to "" -- set this to "-ic 'me@domain.com'" or "" to filter a specific calendar from iCalBuddy - if you are syncing multiple calendars into calendar.app eg from colleagues then you'll need this

set mins_remaining_to_red to 15 -- how many minutes before a meeting should turn the TB widget RED
set mins_overdue_to_ignore to 5 -- will show the current meeting for this many minutes into the meeting then will look for the next event

try
set upcomingEvents to do shell script "/usr/local/bin/icalBuddy -ea -nnc 1 -eed " & calname & " -nc -n -ps '|:|~~|' -iep datetime,title,location -po datetime,title,location -b '' eventsToday 2>/dev/null | grep -v \"^\\.\"  "
on error
-- need this due to iCalBuddy errors being thrown and applescript treating it as an error if no text is returned
-- use this to read the next 10 events - it's sort of a subroutine but not cleanly written - this was the quick and dirty way in applescript that I could find. It works.
set dummy to my setNext10Events(calname)
--if upcomingEvents is "" then
return "{\"text\":\"No more events today\", \"background_color\": \"100,100,100,100\", \"font_color\": \"255,255,255,255\",\"font_size\": 14}"
--end if
end try

if upcomingEvents is "" then
-- this should theoretically catch a clean "" returned by iCalBuddy when no errors are sent to stderr (but I can't confirm this works)
-- use this to read the next 10 events - it's sort of a subroutine but not cleanly written - this was the quick and dirty way in applescript that I could find. It works.
set dummy to my setNext10Events(calname)
return "{\"text\":\"No more events today\", \"background_color\": \"100,100,100,100\", \"font_color\": \"255,255,255,255\",\"font_size\": 14}"
end if

set oldDelims to AppleScript's text item delimiters

-- first let's create an array of the lines of output

set calendar_data to paragraphs of upcomingEvents

set lineCount to 1
set num_mins_until to -mins_overdue_to_ignore

repeat until num_mins_until is greater than -mins_overdue_to_ignore
set upcomingEvents to item lineCount of calendar_data
set AppleScript's text item delimiters to ":"
set theTimeArray to every text item of upcomingEvents
set AppleScript's text item delimiters to "~~"
set theInfoArray to every text item of upcomingEvents
set AppleScript's text item delimiters to oldDelims
set event_title to item 1 of theInfoArray
if length of event_title is less than 7 then
set event_title to event_title & "~[blank event title]"
end if
set event_title to characters 7 thru (length of event_title) of event_title
if length of event_title is greater than maxSize then
set event_title to text 1 thru (maxSize - 3) of event_title & "..."
end if
if length of theInfoArray is greater than 1 then
set event_location to " (" & item 2 of theInfoArray & ")"
else
set event_location to ""
end if
set now to ((time of (current date)) / 60) as integer
set mins_from_midnight to my getMinsFromMidnight(theTimeArray)
set num_mins_until to mins_from_midnight - now
set lineCount to lineCount + 1
if lineCount is greater than length of calendar_data then
exit repeat
end if
end repeat


-- if we are here then we have got the correct line of calendar data to show
-- just have to check if there is another event starting at the same time

if lineCount is less than or equal to length of calendar_data then
-- we have another event after this one so check if the start time is the same
set upcomingEvents to item lineCount of calendar_data
set AppleScript's text item delimiters to ":"
set theTimeArray to every text item of upcomingEvents
set AppleScript's text item delimiters to oldDelims
if mins_from_midnight is equal to my getMinsFromMidnight(theTimeArray) then
set event_location to ""
set event_title to "Multiple events starting"
end if
end if


if num_mins_until is greater than or equal to 60 then
set num_mins to num_mins_until mod 60 as integer
set num_hours to (num_mins_until - num_mins) / 60 as integer
set output_text to ((num_hours as string) & "h" & num_mins as string) & "m " & event_title & event_location
else
set output_text to (num_mins_until as string) & "m " & event_title & event_location
end if

if num_mins_until is less than or equal to mins_remaining_to_red then -- we want to colour code the background to red
set output_text to "{\"text\":\"" & output_text & "\", \"background_color\": \"255,85,100,255\", \"font_color\": \"255,255,255,255\",\"font_size\": 14}"
else
set output_text to "{\"text\":\"" & output_text & "\", \"background_color\": \"100,100,100,100\", \"font_color\": \"255,255,255,255\",\"font_size\": 14}"
end if



-- use this to read the next 10 events - it's sort of a subroutine but not cleanly written - this was the quick and dirty way in applescript that I could find. It works.
set dummy to my setNext10Events(calname)

return output_text



on getMinsFromMidnight(theTimeArray)
if character 1 of item 1 of theTimeArray is 0 then
set item 1 of theTimeArray to character 2 of item 1 of theArray
end if
if character 1 of item 2 of theTimeArray is 0 then
set item 2 of theTimeArray to character 2 of item 2 of theTimeArray
end if
set event_hh to item 1 of theTimeArray as number
set event_hh to event_hh * 60
set event_mm to item 2 of theTimeArray as number
set event_mins to event_hh + event_mm
return event_mins
end getMinsFromMidnight


on setNext10Events(calname)
-- use this to read the next 10 events - it's sort of a subroutine but not cleanly written - this was the quick and dirty way in applescript that I could find. It works.
set upcomingEventsList to do shell script "/usr/local/bin/icalBuddy -ea -nnc 1 -eed " & calname & " -nc -n -ps '| - | |' -iep datetime,title -po datetime,title -b '' eventsToday+10 2>/dev/null | grep -v \"^\\.\"  "
set myevents to paragraphs of upcomingEventsList
tell application "BetterTouchTool"
try
repeat with counter from 1 to 10
set_persistent_string_variable "event" & counter to item counter of myevents
end repeat
end try
end tell
end setNext10Events

remember to update the scripts for the 10 events on the drill down to read the persistent strings. And to change them to update on display.

(slightly annoyingly, I just updated BTT via SetApp about 30 secs ago and all my presets and config changes seem to have reverted to the stock GC-BTT config. Something to look at tomorrow as I'm in the UK and it's late here)


#1035

Hi,
I've just discovered this after buying BTT, it's great, thank you! For now, I've already customised the Calendar to show just one of my many calendars to keep me focused, working just fine.

One small question: I use FinalCut Pro a lot and I'd like to have the TouchBar specific for this software. How is this possible when using your preset, please? For now, I'm using the shortcut: Press ⌘βŒ₯⇧0 to toggle stock Touch Bar UI

Bests,
L.


#1036

@GoldenChaos Is there a way to optionally add a scrubber to the Now Playing interface. Just a way to visually display how much of a track has played and how much is left?

Also, with the Reminders integration, i've pressed and held a reminder and then tapped one but it doesn;t mark it as complete?


#1037

In BTT preferences, on the left side, you'll see "Global" and "Finder" under "Select Application".

Towards the bottom, you'll see [+] [-] [cog App Specific] buttons. Click the [+] and add FCP; select FCP and click [cog App Specific]. Under Touch bar Behavior, you want to select "show app default touch bar".

That way, when FCP is the active window, you'll see the app specific TB; when FCP isn't the active window, it will show BTT's TB.


#1038

It's pretty simple. What you want to do is create a new preset: "Manage Preset" > "New".

Go into GC's present, and right click the "beats" row, and click "Copy JSON to clipboard".

Click manage preset, and disable GC's preset temporarily so you don't get confused. Go into your newly created preset, and right-click and paste JSON to clipboard.

Double click that, and rename "Connect to Beats" to whatever headphone you have so you know that it's for that brand.

Towards the bottom of the script, look for this line:

	if item i of btInfo contains "Beats" and item i of btInfo contains ", 1" then

You want to change "Beats" to the BT name of your device that you see in the BT setting on MacOS.

If you click on appearance and settings, you can drag and drop a glyph (google image search) in the "icon" window or single click the icon window to scroll through a bunch of glyphs.

I'm still a bit unsure on how to get the preset to appear in GC-BTT settings (if I want to enable/disable it), but it doesn't make a difference for me since I always keep it on the main TB.

And then obviously, go back and re-enable GC.


#1039

@rctneil I wish! Sadly, there is no way to add a scrubber at this time. Also, the button there is purely aesthetic for now, and will be functional in a future release.

Thank you for writing that detailed tutorial @Serenity! :smiley:


#1040

I've been experiencing some issues w/ the back & forward buttons and wanted to know if what I'm seeing is known behavior and whether or not there is a way around it (or if it is even an issue).

  • The buttons no longer allow me to move back & forward in finder

  • When Spotify/itunes are the active app, pressing back/forward actually controls music playback. This makes sense since both apps probably define the command+arrow shortcuts to have that functionality but my issue with that is:

    1. I can't use those buttons to actually move a page back or forward which I do a lot on Spotify (yay music discovery!).

    2. It makes those buttons redundant since we already have dedicated playback controls basically right next to them.

I like those buttons for what they provide in safari+chrome but if they are only usable there, I might just hide them or make them present only when usable.