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

Bind/run multiple actions at once #914

Open
YaLTeR opened this issue Jan 1, 2025 · 2 comments
Open

Bind/run multiple actions at once #914

YaLTeR opened this issue Jan 1, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 1, 2025

Allow binds to run several actions sequentially, e.g.:

Mod+G {
    focus-column-right
    consume-or-expel-window-left
}

And, more importantly, add some way to run several actions as a batch through IPC and niri msg action. This will allow doing several actions as one atomic sequence and with no delay in-between, which is currently impossible.

Here the binds and the IPC part should be straightforward, but I'm not sure how to parse the arguments in niri msg action. Maybe clap offers something?

Another question is what to do if only one action in the sequence fails a check like allow-when-locked. Here I guess we ignore just the action that fails the check, same as what would happen if you were to run several niri msg action commands one after another.

@YaLTeR YaLTeR added the enhancement New feature or request label Jan 1, 2025
@YaLTeR
Copy link
Owner Author

YaLTeR commented Jan 2, 2025

Idea from @calops for CLI:

you could also just have an option to read actions from stdin, where you can just put all of them separated with newlines

Though, I'm not sure if you can run a clap parser on stdin to parse the arguments.

@calops
Copy link
Contributor

calops commented Jan 2, 2025

You should be able to run a clap parser on any string manually. It would have to be a subset of the global parser but it sounds doable.

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

No branches or pull requests

2 participants