Awesome
TouchBarKit
Display anything you want on Touch Bar right side of brightness button
This is a Swift version of touch-baer
This uses a private API to display what you want on Touch Bar as a button, it is totally safe!
Screenshots
Get Started
-
Download or git clone my repo
-
Copy the
TouchBar.h
file to your projectIf you are on Swift, you should also create a bridging file
-
Embed
DFRFoundation.framework
to your target in the Xcode.DFRFoundation.framework
can be found in/System/Library/PrivateFrameworks/DFRFoundation.framework
of your Mac
Usage
var touchBarButton: NSButton?
DFRSystemModalShowsCloseBoxWhenFrontMost(true)
let touchBarIdentifier = NSTouchBarItem.Identifier(rawValue: "TouchBar")
let touchBarItem = NSCustomTouchBarItem.init(identifier: touchBarIdentifier)
touchBarButton = NSButton(title: "Hello World!", target: nil, action: nil)
touchBarItem.view = touchBarButton!
NSTouchBarItem.addSystemTrayItem(touchBarItem)
DFRElementSetControlStripPresenceForIdentifier(touchBarIdentifier, true)
Explanation
-
Show close button or not
DFRSystemModalShowsCloseBoxWhenFrontMost(true)
A close button can be like this:
Related
-
ClockBar - Clock, right on the Touch Bar
-
DarkLight - Switch between Dark and Light mode with an ease
Thanks
Big thanks to Alexsander Akers and his project touch-baer