-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: remote control zjstatus with pipes #48
Merged
Merged
Conversation
This file contains 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
Since chrono-tz now fixed the deprecations from chrono we can finally remove the pinning.
dj95
changed the title
Draft: feat: remote control zjstatus with pipes
feat: remote control zjstatus with pipes
Apr 16, 2024
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.
With the next release, zellij introduces pipes for plugins, which allow to pipe arbitrary data to plugins. This allows us to implement a handler, that picks up the lines piped to zjstatus, such that it will be able to receive some commands.
In the first iteration zjstatus will gain the capability to rerun command widgets by sending a specific string through the pipe. To send such a message, simply run
zellij pipe "zjstatus::rerun::command_name"
in the session where the command should be refreshed. Please note the appending specification for the protocol to communicate with zjstatus.Important
This pull request can only be merged as soon as zellij releases its new version!
Protocol description
As the name indicate, the protocol sends messages via lines. This means, that each line will try to be interpreted as one command. Each line has the following structure:
{{prefix}}
is alwayszjstatus
, such that zjstatus will be able to distinguish between messages for other plugins and itself.{{command}}
is the command you want to transmit to zjstatus. As of now, onlyrerun
is possible. The third part is variadic and can provide arguments to the command to run. In case ofrerun
it is the command name as written in the layouts (e.g.command_date
).Commands
rerun
Arguments
command_name
Triggers a command run for the widget with the given name.
notify
Arguments
message
Displays a notification with the given body in the notification widget.