Code Monkey home page Code Monkey logo

touch-baer's Introduction

Touch Bär

Touch Bär uses undocumented, private API to add a Touch Bar button to the Control Strip on the right-band side of the keyboard.

DFRElementSetControlStripPresenceForIdentifier(NSString *, BOOL);
DFRSystemModalShowsCloseBoxWhenFrontMost(BOOL);

+[NSTouchBarItem addSystemTrayItem:]
+[NSTouchBar presentSystemModalFunctionBar:systemTrayItemIdentifier:]

Author

Alexsander Akers, [email protected]

License

Touch Bär is available under the MIT license. See the LICENSE file for more info.

touch-baer's People

Contributors

a2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

touch-baer's Issues

Can this work with Electron?

Is there a way to make this extendable for Electron apps (or React Native MacOS)? I asked the guys over at Electron to make it part of the core lib but they're a bit hesitant to do so because of the api being private and undocumented. This still looks like a cool feature though, so I was wondering if there's any way at all to make this embeddable.

Error in macOS Mojave

I'm getting the following error, when tapping on the Panda (running on macOS Mojave).

2018-07-06 06:26:31.362094+0200 TouchBarTest[60828:1344912] +[NSTouchBar presentSystemModalFunctionBar:systemTrayItemIdentifier:]: unrecognized selector sent to class 0x7fffa27c06c8
2018-07-06 06:26:31.362308+0200 TouchBarTest[60828:1344912] [General] +[NSTouchBar presentSystemModalFunctionBar:systemTrayItemIdentifier:]: unrecognized selector sent to class 0x7fffa27c06c8
2018-07-06 06:26:31.364674+0200 TouchBarTest[60828:1344912] [General] (
	0   CoreFoundation                      0x00007fff4a125484 __exceptionPreprocess + 197
	1   libobjc.A.dylib                     0x00007fff76256d08 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff4a1ae0ad +[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00007fff4a0b2fd2 ___forwarding___ + 1506
	4   CoreFoundation                      0x00007fff4a0b2968 _CF_forwarding_prep_0 + 120
	5   TouchBarTest                        0x0000000100001c55 -[AppDelegate present:] + 117
	6   AppKit                              0x00007fff47d81cd6 -[NSApplication(NSResponder) sendAction:to:from:] + 312
	7   AppKit                              0x00007fff4784c70f -[NSControl sendAction:to:] + 86
	8   AppKit                              0x00007fff4784c641 __26-[NSCell _sendActionFrom:]_block_invoke + 136
	9   AppKit                              0x00007fff4784c541 -[NSCell _sendActionFrom:] + 178
	10  AppKit                              0x00007fff4788aa8e -[NSButtonCell _sendActionFrom:] + 97
	11  AppKit                              0x00007fff47a8ae24 -[NSCell touchEndedAt:inView:] + 333
	12  AppKit                              0x00007fff47a6c55e -[NSButtonCell touchEndedAt:inView:] + 334
	13  AppKit                              0x00007fff47aecab5 -[NSControl _touchEnded:] + 330
	14  AppKit                              0x00007fff47aec915 -[NSControl touchesEndedWithEvent:] + 544
	15  AppKit                              0x00007fff47b9b84c _NSSendTouchEventToViews + 1059
	16  AppKit                              0x00007fff47b9d723 ___NSSendDirectTouchesEvent_block_invoke + 3356
	17  AppKit                              0x00007fff47c242d7 -[NSTouchDevice _preventFlushingContextID:during:] + 169
	18  AppKit                              0x00007fff47b9c977 _NSSendDirectTouchesEvent + 544
	19  AppKit                              0x00007fff47b8f947 _NSSendEventToDequeuingObservers + 337
	20  AppKit                              0x00007fff47d7fdae -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2132
	21  AppKit                              0x00007fff4762988e -[NSApplication run] + 699
	22  AppKit                              0x00007fff475f92b2 NSApplicationMain + 782
	23  TouchBarTest                        0x0000000100001a32 main + 34
	24  libdyld.dylib                       0x00007fff771d9b11 start + 1
	25  ???                                 0x0000000000000003 0x0 + 3
)

Swift Version

Hi !
I am a student who is learning programming just now. I am working on my own little project ,and found that touch-baer is a great tool that can help me to put my icon on touchbar.
Unfortunately , I am learning swift and blind to OC, can you write a swift version of this ?
Thanks!!

Icon Bug

The first icon shown it's a spray can instead of the bear photo, see image. The correct icon only shows after clicking the spray can. Additionally right after pressing on the spray can many controller actions are displayed such as pause, stop, etc.
bug3
bug-1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.