Note: This is experimental, the API may still change. You need BTT alpha 3.086 or later to run the plugins.
This repository will contain examples on how to create BetterTouchTool plugins. Starting with version 3.086 BetterTouchTool supports Touch Bar plugins. Soon there will also be other types of plugins (e.g. action plugins)
Currently there are three types of Touch Bar plugins: Plugins that
- return a string which will be rendered using a BTT Touch Bar button that is fully customizable using the standard BTT mechanisms
- returning a custom NSButton instance that you can style and modify
- returning a custom NSViewController instance with a custom view attached to it.
This repository contains basic example plugins for all three of these types.
A BetterTouchTool Touch Bar plugin must fulfil these requirements:
- its wrapper extension must be ".btttouchbarplugin"
- its info.plist must contain these three keys: BTTPluginName, BTTPluginIdentifier, BTTPluginIcon
- it must conform to the BTTTouchBarPluginInterface protocol (https://github.com/folivoraAI/BetterTouchToolPlugins/blob/master/BetterTouchToolPluginDevelopment/BTTPluginInterface.h )
- it must link against the BTTPluginSupport.framework
- the principal class in the info.plist must be set to the main class that conforms to the BTTTouchBarPluginInterface protocol.
- When using Swift to develop the plugins, make sure to set the principal class to the fully qualified name (PluginName.PluginPrincipalClass).
Please see the example plugins for details!
Starting with BTT 3.226 action plugins are supported. They allow you to extend the list of available predefined ations with your own custom ones.
It's easy to create such an action extension:
- its wrapper extension must be ".bttactionplugin"
- its info.plist must contain these three keys: BTTPluginName, BTTPluginIdentifier, BTTPluginIcon, and BTTPluginType which must be set to "Action"
- it must conform to the BTTActionPluginInterface protocol (https://github.com/folivoraAI/BetterTouchToolPlugins/blob/master/BetterTouchToolPluginDevelopment/BTTPluginInterface.h )
- it must link against the BTTPluginSupport.framework
- the principal class in the info.plist must be set to the main class that conforms to the BTTActionPluginInterface protocol.
- When using Swift to develop the plugins, make sure to set the principal class to the fully qualified name ($(PRODUCT_MODULE_NAME).PluginPrincipalClass).
There is a example action extension included in this project (BTTDisplayNotificationActionPlugin), it shows the basic concepts and can be used as a starting point.
- Clone this project (
git clone [email protected]:folivoraAI/BetterTouchToolPlugins.git
) - Open the project in Xcode
- Run the project.
- Running it will open a simple sample application that loads the three sample plugins and renders them to the Touch Bar - however it does not offer the customization options BTT offers. To see the plugin bundles, select the "Products" group in the XCode side-bar - you can then right-click them and select "Show in Finder".
You can install the plugins into BTT by double-clicking them or by copying them to ~/Library/Application Support/BetterTouchTool/Plugins You can configure these plugins in BetterTouchTool - they will be listed under "Touch Bar Plugins" in the Touch Bar widget selector popover. Action plugins will appear in the standard action selector popup.