An Atom package that allows you to assign custom actions to Touch Bar components.
JavaScriptMIT
Touch Bar Utility
Beware This package only works with Atom >=v1.19
An Atom package that allows you to assign custom actions to Touch Bar components.
Usage
Go to File → Settings → Packages
Find touch-bar-utility and click on the card but not on the name of the package
Go to Settings and edit the Buttons entry with a JSON array of Touch Bar components
A component has the following format: {"type": "<typeOfElement>"[, ...]}
Touch Bar Components
TouchBarButton (type: "button")
Name of variable
Type of variable
Optional
Description
label
String
Yes
Button text.
backgroundColor
String
Yes
Button background color in hex format, i.e #ABCDEF.
pathOfIcon
String
Yes
Path to button icon.
iconPosition
String
No
Can be left, right or overlay.
click
Function
Yes
Function to call when the button is clicked.
clickDispatchAction
String
Yes
Event from another package that you want to execute when button is clicked. It will override the click property. It must be in the following format: "<package-name>:<event-name>" without quotation marks.
dispatchActionTarget
String
Yes
Can have a value of 'workspace' or 'editor'. It defaults to 'workspace'.
TouchBarColorPicker (type: "color-picker")
Name of variable
Type of variable
Optional
Description
Return values
Return values type
Return values description
availableColors
String[]
Yes
Array of hex color strings to appear as possible colors to select.
selectedColor
String
Yes
The selected hex color in the picker, i.e #ABCDEF.
change
Function
Yes
Function to call when a color is selected.
color
String
The color that the user selected from the picker
TouchBarGroup (type: "group")
Name of variable
Type of variable
Optional
Description
items
Array of elements
No
Items to display as a group.
TouchBarLabel (type: "label")
Name of variable
Type of variable
Optional
Description
label
String
Yes
Text to display.
textColor
String
Yes
Hex color of text, i.e #ABCDEF.
TouchBarPopover (type: "popover")
Name of variable
Type of variable
Optional
Description
label
String
Yes
Popover button text.
pathOfIcon
String
Yes
Popover button icon.
items
Array of elements
Yes
Items to display in the popover.
showCloseButton
Boolean
Yes
true to display a close button on the left of the popover, false to not show it. Default is true.