phoscur / oryx-macro-hax Goto Github PK
View Code? Open in Web Editor NEWA hack to get around the 5-button max Macro limit in Oryx for Ergodox / Moonlander keyboards.
A hack to get around the 5-button max Macro limit in Oryx for Ergodox / Moonlander keyboards.
Catching up here, just wanted to pop in to say thanks for taking the project over!
Following up on gittyeric#7
We need to stop comment out eachothers macros.
I want to refactor
macros/<username>
- add feature flags to enable loading multiple macro collectionssrc
folderI can't decide which Oryx Layout to use as a base, because I want layers from multiple sources!
Then, I have something for you, now!
Generated an API Client SDK and created a little CLI prompter to copy layers from other layouts:
https://github.com/Phoscur/oryx-layer-inserter
Best regards,
Phoscur
(shameless self-advertisement)
Feel free to brainstorm what we can achieve by merging the repos, or maybe making use out of the API Client SDK through npm dependency! Follow up on #4:
I think I'm failing to update the .env file correctly.
I copied the text in the provided .env.dist file into a new file I named 'process.env', and confirmed that it is a file of type .env. I've updated it with my information, as follows:
USER_NAME="DeepSky8"
LAYOUT_ID="0LXoN"
LAYOUT_FOLDER="moonlander_qwerty-js_source"
LAYOUT_SRC="./layout_src"
--
When I run
npm run get -- 0LXoN
I receive the following update and error:
Downloaded layout "0LXoN" to ./layout_src (from https://oryx.zsa.io/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBNTAxUUE9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--bb15af0be4346b3ef05dc6d4b34036ec6d80b9ad/moonlander_qwerty-js_0LXoN_Jyz49.zip).
TypeError: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:400:5)
at validateString (node:internal/validators:163:11)
at join (node:path:429:7)
at C:\Users\Joel\qmk_firmware\ergodox-macro-hax\src\oryx-downloader.ts:53:29
Could you offer some insight what I'm failing to do correctly?
Thanks!
For Windows (but also other operating systems), we will assume that Wally is already preinstalled, it should just be launched and fed with the most recently built firmware.
wally-cli -f <path-to-firmware-file>
Remains to be found out what firmware path we give it, currently recommendations are putting it into a parent folder where one manually compiles it. Alternatively, it could be downloaded from the latest action pipeline...
I want to import layers from https://github.com/JHoahg/The_NEO_has_landed
There won't be any way to bring this back nicely into Oryx, from [email protected]:
โข Allow import & export of layers by JSON serialization through the GraphQL API
I'm afraid we're pretty firmly against this for Oryx for a few reasons. Any form of uploading is really off the table just out of an abundance of caution. We did also consider adding a way to copy layers and keys but ultimately decided against it, as then it would be super easy to copy a bunch of things and end up with an unmanageable layout -- or even to run up against your keyboard's firmware size limit.
Or is there... I'll keep writing back and forth with them a bit more.
And we could still just set them one by one through API or Browser automation...
While #10 should focus on the most used commands, the yet-to-be fully drafted command wizard
is going to use the insight from oryx-layer-inserter to guide through macro creation (and copying layers).
Wizard may automate macros/username.ts
creation and append new macros
list
macros with and without expansionsetup
create the macros filecreate
macro creation for a specific key -> set-key
insert
copied/blueprint layer (import from layer-inserter)save
push + download-bin
wait for the action pipeline then get the firmware fileI think create
needs an adequate representation of the layer to select a specific key. I have to check how much the prompting library changes on this.
(Refactor #8 to use inquirer (+ zod & @molt/command))
Do you have additional ideas? What are your thoughts about this?
Following up on #7 and some experiments in oryx-layer-inserter I created #8 with yargs
, prompts
& node-persist
, this covers a base for better UX, adding more commands & caches, as well as merging the repos.
auth
get JWT authorization token (manual, only possible to automate as user script)data
get my layouts listopen
new layout revision (manual, TODO automate?)insert
(create/copy) layer (#6)set-key
WIP (#6)wizard
create username file, prototype macros #11get*
(download-src
) keymap sourceprocess*
keymap expanding macroscompile*
flash*
(manual, TODO #12)*unauthorized mode - auth
is actually not needed (only layoutID
)
The last three commands and potentially essential parts of the wizard cannot be run inside the browser, but they could also generate a browser snippet to set the macro key, for example. I might explore this later, so the layer-inserter will become a playground for tamper monkey scripts.
auth
- prompt to get the auth token is a messy manual task, description: localStorage.getItem('jwtToken')
data
- provides layout & layer IDs (a bit slow for many layouts)open
- create a new revision, required if the layout is to be modified (insert
, set key
) - manual for nowwizard
- guide through macro creation TODO #11get
(download-src
) - get & unzip the keymap source TODO check openprocess
- apply macros expansion, add stuff to the keymap.c filecompile
- call qmk
locallyflash
- call or at least open Wally (#12)auth
- needs just to be checked, the token is quite long-lived, if it timed out fall back to caches & prompts in "unauthorized" modewizard
- just skip to change a typo in a macro, or add one from a blueprint... #11open
- don't, just check that no open revision exists, to be ready to download - recognize unchangeddownload
- only if the layout changedprocess
, compile
, flash
& data
- meanwhile processing update cachesI'd like to implement the fast path first: "new but closed revision found" - download & process - no prompts.
How important is this "unauthorized mode"? Likely depends on the usefulness of the wizard (#11) and the potential selection of new macros from a yet-to-be-created macro and layer library... (#6)
What are your thoughts about this?
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.