Hello, new OS X user (MBP 15 with TouchBar).
So, Google chrome has the default click-to-navitage-or-search touchbar button, but I wanted something more. It was annoying that I had to lift my head up to the screen to see my typed search string.
So, I googled, found BetterTouchTool, and decided to give it a go, I got almost everything working.
- BetterTouchTool has a "Run script and show return value" widget that is shown only for chrome.
- When this button is clicked, it send Command+L or the key combination to focus on the NavigationBox, and it types "TouchBarDict" and hits Tab.
- This starts an Omnibox session handled by a chrome extension I have just written, the extension listens for the string the user is entering, and sends GET requests to BetterTouchTool webserver, with updateWidget text=<search_or_url_string> - Basically it shows what the user is typing right there in the TouchBar instead of lifting the eyes to the monitor.
It's working. But for it to be polished and nice there are a few things I could improve.
-
chrome.omnibox.onInputChanged will only fire after the first letter has been entered into the omnibox. This means I have to chain actions in BetterTouchTool to change the text to something like "Start typing to search or navigate..." when before that I was displaying "Click to search or navigate".
-
If the user doesn't type anything but actually clicks ESCAPE in the omnibox, I get no events for this, because no text was ever entered, there is nothing to cancel, chrome won't fire an event about that. Now the widget text is "Start typing to search or navigate..." and I want it to go back to "Click to search or navigate"
-
I want the width of the widget to take all available space in touchbar, right now it is shrinking to contain text size + some margins.
Thanks in advance for any tips, or feedback.
Eitam.