by finne on 21-07-2017

Using the MacBook Pro Touch Bar in PhpStorm with BetterTouchTool

July 2017

The last two generations of Apple MacBook Pro have a Touch Bar. It's usefulness is much debated. I find that good touchbar support makes apps easier to use. Affinity Photo and MAMP PRO and Apple Photos do this nicely. However the app I use most each day is JetBrain's PhpStorm. This app has no touchbar support, although a ticket has been opened to request this.

In the mean time, there is a great tool called BetterTouchTool (BTT) by Andreas Hegenberg which allows you to program custom actions for any input method. This includes trackpads, mice, keyboard and the touchbar. BTT is great, but has a million options and possiblities. You really need to sit down to configure it properly. The blogpost by Alex Wolkov is a great help for this. 

A good custom touchbar also needs good, clear icons. If you want to reuse icons that are already in use on the touchbar or elsewhere in MacOS, you could take a look at (for example)
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/Assets.car. For this you need a .car archive reader, such as Asset Catalog Tinkerer by Guilherme Rambo. This nice app includes a QuickLook plugin. You can drag icons from this app directly into BTT.

Putting this all together I configured a PhpStorm specific touch bar:

phpstorm touchbar

This configuration can be exported and imported as presets in BTT. Attached you can find my configuration. If you import this in BTT you can copy individual actions including their icons from my preset to your own config. 

Incidentally, to take a screenshot of the touchbar use the command-shift-6 shortcut.

I also configured a globally visible touchbar with power, eject and delete buttons and advanced iTunes actions such as change iTunes (not system) volume and switch to next available Airplay device:

global touchbar

about the author

Finne Fortuin is a Drupal 8 expert who likes to configure his development setup to perfection.

Finne