Open
Conversation
Member
|
I was literally about to start on this, great timing! |
Member
|
Some quick thoughts:
|
Collaborator
|
Should probably just handle auto.sh and have that be an |
Author
|
I've implemented the suggestions and vibed a little demo app: I had it generate the documentation based on my changes so that I can at least show off where I'm going with it. The demo pakz is functional but need the updated scripts to function. Open to suggestions. The hooks themselves are not vibed, but I still need to validate further and do a lot of testing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Launch Hooks
This has been suggested a few times in the Discord so I thought I would do a more formal pitch.
I'm currently adding a feature the Shortcuts pak that allow X to Resume to work. What this basically does is sync the states to proper location so that the existing NextUI code picks this up.
The idea
Hooks are platform-specific, just like paks. The launcher reads them from:
On device,
USERDATA_PATHresolves to:So the actual hook directories on device are:
Example installed hook path:
If these directories don't exist, nothing happens and there is no overhead.
Environment variables
Hook scripts inherit all standard NextUI environment variables (
SDCARD_PATH,PLATFORM,USERDATA_PATH,SHARED_USERDATA_PATH, etc.) plus these launch-specific ones:HOOK_PHASEpreorpostHOOK_TYPEromorpakHOOK_CMDHOOK_EMU_PATHlaunch.shHOOK_ROM_PATHHOOK_LAST/tmp/last.txt(the last selected menu entry)These can then be used by the underlying Pak to ingest information about the hook that just occurred.
Writing a hook script
A hook script is any executable
.shfile in one of the hook directories. Scripts run in alphabetical order.Rules
Example: sync after ROM exit
See also my resume-hook branch within Shortcuts for an example implementation that uses this system.
Other thoughts