[WIP] Offer some features à la carte #26
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Historically, if you wanted to use only a subset of this repository's functionality, you've had to edit the code to apply your customizations (e.g., removing the
require
statements for features you don't want). This PR explores one option for providing a more à la carte offering.It's just an exploration for now. It's too soon to say whether this will be something that's worth merging. 🔮
Approach
The recent 0.9.53 release of Hammerspoon introduced an official mechanism for distributing custom Hammerspoon-based plugins known as Spoons. From the Hammerspoon docs:
If I can extract some of this repository's features into standalone Spoons, and if doing so makes it easier for people to choose the custom subset of features they want, and if it doesn't significantly increase maintenance overhead, then I'd love to make it happen. 🤞
Proof-of-concept
As a starting point, I've extracted a Spoon to provide the functionality that allows you to tap caps lock for escape and hold caps lock for control. Instead of housing that functionality directly in this repository, that functionality is available à la carte as a Spoon (https://github.com/jasonrudolph/ControlEscape.spoon), and this branch includes that Spoon as a submodule. For people that only want that one feature, they have access to it via that standalone Spoon. For people that want all of this repository's features, this branch continues to provide all of the original functionality.
TODO
script/setup
to symlink all of this repository's Spoons into~./hammerspoon/Spoons/