Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make USB scripts work #891

Closed
llinfeng opened this issue Jan 8, 2019 · 9 comments
Closed

Make USB scripts work #891

llinfeng opened this issue Jan 8, 2019 · 9 comments
Assignees
Labels

Comments

@llinfeng
Copy link

llinfeng commented Jan 8, 2019

I enjoy UHK sooooo much that I ordered my second pair right when I received the first one, and now I have two of them. Yet, it is a bit of trouble to "sync" the settings on these two.

For now, I have been happily pressing my mouses in the GUI of the UHK Agent, and have only done so for one. Yet, for an indefinite time to come in the future that I shall be happily typing on UHK, I'd like to press a button on UHK to save-to or source-from the UHK_master.json file that I keep in Dropbox.

Please advise if the feature has been in place. Then, how can I call the Agent from the command line, and what flag should I use to specify the action + whereabouts of the source json file?

@llinfeng
Copy link
Author

llinfeng commented Jan 8, 2019

I use Windows 10 most of the time, but I think it is also appropriate to ask for support on other OS here.

@owlstead
Copy link

owlstead commented Jan 8, 2019

This kind of behavior has been discussed before (e.g. by me). Currently there is limited amount of copying possible between key maps and such things. I'm currently writing other software, but handling JSON files is not that hard, so you might want to try yourself - if you're into programming. Copying / editing them manually is also possible; you need to make sure the map switching etc. is OK, or the Agent will not load the files.

Note that I'm not part of the UHK crew.

@mondalaci
Copy link
Member

Thank you very much for your big support, @llinfeng!

We'll eventually implement a cloud sync feature, but it'll take quite a while, and it won't utilize Dropbox. In the meantime, we have a couple of useful scripts in ${agentDir}/packages/usb, but they're not actively maintained, and the relevant read-config.js and write-user-config.js scripts don't seem to be working. We'll fix them eventually, but they're not a priority right now.

@luteijn
Copy link

luteijn commented Jan 9, 2019

As I now also have two keyboards, I'll probably look into this a bit more myself (eventually...) and will at least keep track with interest of what progress is made on this front.

@Dagon
Copy link

Dagon commented Jan 9, 2019

I'm in the same boat - ordered a second for work about a week after I got my first one for home. I don't update keymaps very often - a bunch when first setting up for a new environment/layer and now maybe once every few weeks. So far, it's worked to use Configuration->Export on whatever machine I've just made a change, and then Import on the other (I just rsync a directory of random window and app config files rather than dropbox, but same idea).

I've got some really hacky python scripts to try to do partial-layer-copies on an export file. This works, but is kind of ugly and requires hacking whenever I want to change which keys are shared between which layers.

I'd enjoy the ability to automate this, but it might be part of a bigger and more interesting agent feature: agent scripting. If I could write a file of commands/clicks for Agent to execute, and run that from the commandline, I could script anything, from simple key changes to fairly complicated copy-and-edit of layers.

@kareltucek
Copy link
Contributor

@Dagon, I am afraid that we won't get any advanced features for the Agent anytime soon. Yet, regarding the possibility of dynamic construction of layers/keymaps, I see quite some potential in firmware hacking. If you are interested, please check the https://github.com/kareltucek/firmware repository and kareltucek/firmware#2 and let me know what you think about it. (Currently, the firmware allows having "hold" layer switches pointing to layers of different keymaps.)

@mondalaci
Copy link
Member

Programmatically importing and exporting the configuration is planned, but not maniuplating it (which should be relatively easy given that it's JSON).

We'll have to focus on module related features, so no advanced features are planned anytime soon, indeed.

@mondalaci mondalaci changed the title Can I import/export settings from command-line, by adding some flags and some directory settings? Make USB scripts work Oct 23, 2019
@mondalaci mondalaci added the bug label Oct 23, 2019
@mondalaci
Copy link
Member

The fix for this issue should also address #429, so I'm closing the latter.

@mondalaci
Copy link
Member

#1345 just added packages/usb/{read-config,write-user.config}.ts which allow synching UHK configurations programmatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants