A standard set of responsive, energy efficient widgets (volume / brightness / calendar / timer / world clock / git)

It uses perisistent command line services (basically small macOS apps) that run in the background and only update the Touch Bar when absolutely necessary. The behavior is as close as possible to the BTT-provided widgets.

Most presets just use a scripting language like AppleScript to repeatedly poll and update the Touch Bar. Scripting definitely can work well and is straightforward to implement and modify, but it comes at the price of battery life impact (usually around 1 hour reduction). Additional empirical data here: (Updated) Testing the battery life impact of AppleScript widgets. In comparison, persistent command line services that push updates will have no battery life overhead apart from simply keeping BTT open.

1 Like

Could you please help me, my calender widget doesn't work. Is my bash file correct?

Hi, I tried both with and without double quotation. Both didn't work..

It shows "Calendar error".
Thank you very much in advance.

I found out, service-runner.sh must be manually started with terminal :slight_smile:

Hi, glad you figured it out. What version of BTT are you running? The service runner should automatically start whenever BTT launches and then re-checks every minute. Can you take a screenshot of your Touch Bar configuration in BTT?

Hi Andrew, I use BTT 2.636.

Hi Andrew I use 2.636.
This is the working one for the widgets

Now it works perfectly! :slight_smile: and I bought a lifetime license. Thanks andrew

One thing I also noticed.
AFter sleep time of some hours, BTT is running but sometimes does not show the touch bar so I have to restart it.

Looks like the service runner widget is disabled (third entry Shell Script/Task: that isn’t marked as visible). For automatic service management you should make sure that it’s visible. Did you by chance manually hide that widget, or did it import into BTT 2.6xx that way?

Ah that’s the reason why. I accidently manually inactivated it.

Thanks a lot Andrew! :slightly_smiling_face:

Hi Andrew, I just activated it and the calendar and other widgets on the left side disappear. If I inactive the Shell Script/Task:, they appear again.

Edit: I just fixed it. It works now :slight_smile:

Hey @andrewchidden! Nice preset :slight_smile: I've been giving it a try and making a few tweaks here and there to match my dev environment, and so far there's only one thing I'm having problems with: the calendar widget.

What's really strange is that the eventkit-service is running, the web server is set up, the port is correct, everything seems to be fine when I debug, the pid is set properly etc. but the status file stays empty. When I launch it myself from my shell however, with the exact same arguments, it works perfectly and updates the widget in real time.

Any idea why it would work when I run it by myself and not when it's ran by BetterTouchTool calling service-runner.sh ? I can make it so that the script is ran at startup of my computer, since that'd fix the problem, but if I can avoid it that'd be great :slight_smile:

Let me know!

EDIT: Actually when I launch the service-runner.sh script in my terminal instead of from BTT, it also works :thinking: So it seems that the problem comes from running the script from BTT.

Ok, a few questions to help debug:

  1. What version of macOS and BTT?
  2. Is the btt-system folder ~/.btt or another path?
  3. If you killall eventkit-service, remove the eventkit sub directory, and relaunch BTT, does the folder reinitialize?
  4. Is the BTT service runner widget visible in your BTT configuration?
  5. Do you have the latest controller scripts? I pushed a patch a few weeks ago that fixes an issue with system reboots breaking the service runner.
  1. OSX 10.14 (18A389) / BTT 2.641
  2. System folder changed to another path, since I don't like having too much stuff in my home folder
  3. If I killall, remove the sub directory (or the files) and relaunch BTT, the files are recreated, the pid file is properly set, but the status file is empty.
  4. I since removed it and now my fishrc (equivalent to bashrc) simply calls the service-runner every now and then instead, but at the time of writing my previous message yes it was turned on, visible, the services were running with the expected arguments
  5. I just installed everything a few hours before posting this message so yes, latest versions

Also if you're interested I made a few tweaks I could share on your GH repo, such as:

  • If the string for the next event is more than X characters long (30 in my case), it's printed as "first 15 characters...last 15 characters" to ensure that it always stays pretty much the same size (important for muscle memory)
  • Added a few color variants so that if there is a git diff it's highlighted in green while no changes is displayed in plain white; and that if an event is coming up in the next 59 minutes it's highlighted in red (I often forget about events despite the notifications)
1 Like

Sure, if you make some PRs I can take a look at them. However for the colors, can you put it behind an env variable flag?

Regarding the calendar status file, the only thing I can think of that might be causing it is a lack of calendar access permissions for BTT or similar. Try checking in System preferences (ether security or accessibility, can’t remember).

Minor update:

  • Configurable calendar event truncation (thanks to @Ullaakut)
  • Calendar widget now ignores all day events
  • Better performance for all control strip buttons which also lets macOS automatically handle any modifier key behavior

Services are still being unit tested.. apologies to those compiling directly from source.

@devynosborne I looked into updating to 2.6xx, but there’s a bunch of small annoying things I noticed right away that I don’t have time to deal with right now; weirdly bold fonts, unnecessary animation when showing / hiding widget groups, etc. Things did seem to transfer over okay, so importing the preset should (generally) work for those who need to use the latest BTT.

@andrewchidden Thanks!

In the interest of cleaning up my settings of mess and unused widgets and presets (thanks to trying several presets in the beginning), I simply decided to start fresh. I deleted BTT (after backing up) and installed v2.536. Then I went straight for your install (I'll add some other faves back later). :slight_smile:

I did my best to follow your instructions, but several things are not working. I feel I must be missing something easy, perhaps because I'm not a developer, or maybe it's just late on a Sunday night.

My issue is same / similar to Krotsu above, where brightness and volume controls do not work, except for long press actions.

If I read his / your solution correctly, it has to do with his ".bash_profile". The thing is... I don't even know what that is. :-/

If you could point me in the right direction, or even better tell me the obvious thing I'm missing, I'd be much obliged!

Hi, would you mind sharing your current preset?

It looks like this:

And you can find the preset files in my GitHub repo for OSX setup.

@andrewchidden - to clarify my troubleshooting steps:

I followed the same steps as Krotau above, getting the same results each time, including your Terminal command getting the volume to work -- and up to and including the point you asked him to see what shows in the "Predefined Action" for "Volume Down". It seems to show the same thing:

Except I never created or named ~/.bash_profile -- and as I said, I don't even know what that is (other than some Google-ing which quickly loses me). So I feel stuck on this part.

Perhaps it's something else entirely, but that's what I got.