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

Feature discussion: Window functions #179

Open
CMJones001 opened this issue Jun 5, 2022 · 4 comments
Open

Feature discussion: Window functions #179

CMJones001 opened this issue Jun 5, 2022 · 4 comments

Comments

@CMJones001
Copy link

I'd like to add the ability to run more complex functions on the selected windows, inspired by the Emacs packages avy and ace-window.

In short, in addition to the list of hint characters,sadfjklewcmpgh, there is also some (user configurable) HashMap of functions acting on the window, for example, {"x": wm::WindowCommand::Kill, "F": wm::WindowCommand::FloatToggle}. Then pressing the key d would jump to window d as usual, but xd would instead kill window d.

I've got a basic implementation of this working, if you're interested in a pull request?

@svenstaro
Copy link
Owner

I think that'd be rather cool if you can come up with a generic solution.

@plurry
Copy link

plurry commented Jul 6, 2022

I don't get why this is better than configuring kill and float and whatever else in your i3 config and just using wmfocus to choose the window.

@CMJones001
Copy link
Author

Mostly action economy, with this approach the window action can be performed with a single extra key, instead of: launch wmfocus; select window; run i3 kill command and launching wmfocus again to jump back to the original window.

@plurry
Copy link

plurry commented Jul 8, 2022

I dunno.

You could make a binding mode and put your single key actions there, with i3-msg and [id=$(wmfocus -p)] to perform them. I guess you'd lose focus being the default action, but I bet there's even a way to set that up too.

Or if kill and float are really all you need, you could just give them their own dedicated shortcuts without even entering a binding mode.

But it's not like kill and float are the only cool verbs. Almost all the i3 window commands make sense in this context, and some of them have a more complicated syntax. If wmfocus starts trying to implement them, there would soon be so many options that there should be a file somewhere to save them in.

Which is what i3's config file already is. And leaving that to i3 lets wmfocus do its one thing and do it well.

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

No branches or pull requests

3 participants