Skip to content

Display anything you want on the Touch Bar right side of brightness button

License

Notifications You must be signed in to change notification settings

L1cardo/TouchBarKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

image image image image image

Get Started

  1. Download or git clone my repo

  2. Copy the TouchBar.h file to your project

    If you are on Swift, you should also create a bridging file

  3. Embed DFRFoundation.framework to your target in the Xcode. DFRFoundation.framework can be found in /System/Library/PrivateFrameworks/DFRFoundation.framework of your Mac

    image

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

  1. Show close button or not

    DFRSystemModalShowsCloseBoxWhenFrontMost(true)

    A close button can be like this:

    image

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

About

Display anything you want on the Touch Bar right side of brightness button

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published