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

feat: remote control zjstatus with pipes #48

Merged
merged 24 commits into from
Apr 16, 2024
Merged

feat: remote control zjstatus with pipes #48

merged 24 commits into from
Apr 16, 2024

Conversation

dj95
Copy link
Owner

@dj95 dj95 commented Mar 12, 2024

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}}::{{command}}::{{args}}

{{prefix}} is always zjstatus, 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, only rerun is possible. The third part is variadic and can provide arguments to the command to run. In case of rerun 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.

@dj95 dj95 mentioned this pull request Mar 12, 2024
@dj95 dj95 changed the title Draft: feat: remote control zjstatus with pipes feat: remote control zjstatus with pipes Apr 16, 2024
@dj95 dj95 merged commit 0723923 into main Apr 16, 2024
2 checks passed
@dj95 dj95 deleted the feature/pipes branch April 16, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant