worie / btt Goto Github PK
View Code? Open in Web Editor NEWLow level MacOS management in JavaScript via BetterTouchTool
License: MIT License
Low level MacOS management in JavaScript via BetterTouchTool
License: MIT License
this package can be run both on frontend and backend - to ease up working with web view, I'll create a boilerplate for createing apps that are supposed to be used within btt web view.
Mentioned in https://community.folivora.ai/t/floating-html-settings-menu/5788/9?u=worie . Basically Andreas implemented some JS functions that invoke native APIs without the use of webserver. I'd like to find a way to add optional support for those - simply because they should be faster (and can be run without BTT webserver enabled at all, which seemed impossible at first)
Currently if you run npm run build
, the build process goes into infinite loop for some reason - i guess it is due to fact that typedoc builds its files, perhaps that may be it but it's a wild guess.
There's a mess in Utilities or Events.ts files - because jsons need some manipulations to work properly in BetterTouchTool. I'd like to create a separate service for managing this part of the package
As of alpha 2.685
there's a new action trigger_named_async_without_response
which can be used in favor of trigger_named
. Wrapper does not operate on trigger response anyway, so using the new method which works better for broader spectrum sounds like a good idea. More on that here: https://community.folivora.ai/t/floating-html-settings-menu/5788/44?u=worie
Currently, addEventListener method of this package just creates actions and attaches them to BTT.
But it could respect any other JavaScript function, for example setInterval, timeout, fetches etc.
btt-server
subprojectbtt-server
side.as of 3.1
, widgets and triggers seems broken. Version 3.2.1
will fix this.
Find a way of easy deployment of the generated docs somewhere without polluting the repo and update the link in the README.md
Just realized that there's no simple way to update the action that is meant to happen upon clicking touchbar widget from the lib - I'll try to add support for both addTriggerAction
(for use without btt-node-server) and addEventListener
.
Just to prevent further mess in the common/utils
As touchbar widget is just a trigger, this is already possible to do. However I'd like to add a method that'll allow to do it a little bit easier in the Widget Class
Hey there Worie - this is an awesome library, and you're doing a great job! I'm trying to set up btt-node-server
alongside this library, and I'm running into some issues.
First of all, I can instantiate btt
(which I've installed within a local Create React App) in the browser and execute triggers in BTT. It's awesome.
However, when I attempt to use btt.addEventListener
to access btt-node-server
, an error prints in my console:
Sorry, you have to provide the node/bash binary path manually in the params
The shortcut I input as the first argument (cmd-alt-opt-u
etc) appears in BTT but doesn't have any actions associated with it. It's just the keyboard command.
I've been digging into the AppConfig
and I found the nodeBinaryPath
option, but when I set that, the app crashes when I try to call btt.addEventListener
.
Here's the config:
Browser:
const btt = new Btt({
domain: '127.0.0.1',
port: 58267,
protocol: 'http',
version: '2.687',
sharedKey: 'yourSharedKey',
nodeBinaryPath: '/usr/local/bin/node',
// pass eventServer to use this part of the lib
eventServer: {
domain: '127.0.0.1',
port: 8888,
},
});
btt-node-server:
BTT_DOMAIN=127.0.0.1
BTT_PORT=58267
BTT_PROTOCOL=http
BTT_SHARED_KEY=yourSharedKey
BTT_VERSION=2.687
PORT=8888
Any ideas? I can just use the btt library to execute triggers that I've already defined, but I'm just curious why it's not working.
There's a bug with type definitions exporting. If you install the package from NPM, the typings won't work. If you clone the repo manually and run npm link
in it, then npm link btt
in your app, it'll work. But surely, this is just a temporary solution and everything should be working fine when using npm build as well.
Will be done in 3.2.0
Checking out the example clock-widget.js, is it possible to create, say, a button widget inside of a group in the Touch Bar?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.