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

Custom actions #4

Open
Jemi opened this issue Apr 8, 2021 · 2 comments
Open

Custom actions #4

Jemi opened this issue Apr 8, 2021 · 2 comments

Comments

@Jemi
Copy link

Jemi commented Apr 8, 2021

I haven't tried xprompt yet, but I was looking through the raw manpage on github, and it looks like the keybindings are just geared towards specifying the actions that xprompt itself knows how to perform. Xprompt should also also allow specifying a separate, fully custom set of keychords which, when triggered, send a custom piece of data back to the wrapper script so that it can take an appropriate action. Implementing this would fill in a big hole in dmenu functionality.

These custom actions could be implemented as environment variables with multiple fields, e.g. like this (in bash syntax):

XPROMPTCUSTACTION01='CTRL-r:BOBSYOURUNCLE'
XPROMPTCUSTACTION02='ALT-4:LIFETHEUNIVERSEANDEVERYTHING'
XPROMPTCUSTACTION03='CTRL-!:ONCE, UPON A MIDNIGHT DREARY AS I PONDERED WEAK AND WEARY'
XPROMPTCUSTACTION04='ALT-B:' #<- where data is arbitrary data, whether or not it fits into the UTF-8 character set, although you could use null as the terminator for these data strings if you really had to, as null is pretty commonly avoided in environment variables anyway.

@phillbush
Copy link
Owner

That's an interesting idea.
I think I'll implement custom keybindings in the input itself, rather than in environment variables.
I'm gonna implement it probably in the next week.

@Jemi
Copy link
Author

Jemi commented Apr 14, 2021

You mean like the handler program emits a DSL for keybindings mixed with the list it's outputting à lá dzen, or as command line args? It seems to me the latter would be better normally, as the former gets kind of complicated. The former makes sense only for context sensitive keybindings, and should have it's own switch.

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

2 participants