-
Notifications
You must be signed in to change notification settings - Fork 81
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
Be able to map key -> action pairs using a template inside of gen_keybindings #22
Comments
Hi @roelycooly , can you fill in the details outlined in the issue template for this? I thought I'd set that up to auto-fill when creating a new issue but maybe not. |
Alright, lol sorry I saw that and thought it was some weird filler thing I was supposed to remove that github put. I changed the comment and will do so with my other enhancement request |
Hi @roelycooly , are you able to give some concrete examples of how you are wanting to use this? I had a go at hacking something together the other day and I wasn't able to come up with anything that felt general purpose enough to warrent being part of the macro. You iterate over &str / String elements in the vector and format them into the keybindings, and then all you can really do is use the index as a Selector in a method that takes one (not all methods do), or pass that key to a function / closure that works out the binding (which defeats the point of having a simple iteration) |
An example from something like sxhkd would be:
Or:
This is pretty much the functionality that I would like implemented. |
Ah ok, that makes more sense: you're not formatting the keys themselves into the binding, you want to map key/value pairs in a template. I'll update the issue title and description and hopefully should be able to get on this soon. I can see why you want it! |
Ya sorry, English is my first language and yet I can never put my words together properly lol, but yeah a template is what I was trying to say. Anyways I hope it wouldn't be too much trouble implementing it and thank you for updating my comment. |
improved keybinding generation for issue #22
#68 provides an implementation sufficient for the simple given in the edited issue description. A full implementation of sxhkd functionality is going to be significantly more work to achieve it seems. For now I'm going to close this issue but I'll keep tinkering away with the keybinding generation macro over time and hopefully should be able to extend things further at a later date. |
name: Dynamic Keymap
about: Be able to give the gen_keybindings macro a vector of keys to iterate over and format each key into a general keymap template such as
M-A-{}
.title: Dynamic Keymap
labels: enhancement
Is your feature request related to a problem? Please describe.
I want to be able to give a vector of keys to format into a general key binding.
Describe the solution you'd like
Either an extension of the gen_keybindings macro, for example a
forall_vec
option, or another macro that implements this for general useDescribe alternatives you've considered
I've only considered an extension of the macro such as an optional
forall_vec
option, or an entirely new macro for this purpose.Edit (sminez):
As discussed in the comments below, this is more about taking key value pairs and mapping them within a template a la sxhkd. A full implementation like sxhkd is probably beyond the scope of this initial request as that involves forming the cross product of multiple expansions and also generating method / key names it seems. For this, the following example should be sufficient:
something along the lines of the following is likely what we'll end up with (not valid methods in penrose but using the same example for clarity):
The text was updated successfully, but these errors were encountered: