xprompt: a dmenu rip-off with contextual completion - Programming On Unix

Users browsing this thread: 1 Guest(s)
seninha
Long time nixers
(16-08-2020, 03:54 AM)vain Wrote: Ohh, that looks interesting.

I’m having a few focus issues (oh god, why is focus handling on X11 such a disaster?) and I wonder: Why did you chose to not show completion options immediately? The user has to press “Tab”. Probably personal preference to make it behave more like a shell?
Thanks. I had the idea for xprompt after having to write "mpc" on dmenu for open a new dmenu listing mpc commands that opened a third dmenu listing my songs. Three dmenus for a single command. Now I only click Tab a couple of times and no need to reopen an application multiple times.

I am also having problems with focus. When xprompt closes, the previously focused window loses the focus and the focus goes to whatever window is below the cursor. That's probably not a xprompt problem, but a problem on the wm I'm writing (the one I'd emailed you about). Indeed, focus handling in X11 is a pita.

(16-08-2020, 07:34 AM)venam Wrote: That's pretty cool!

I was intrigued about how to generate a list that would be compatible with your program based on some shell completion. I wasn't able to extract it out of zsh so I went with bash completion, and here's the result:
Thanks. Now that you have done it, I will do something similar with my ksh completions. Too bad it is not as involved as bash's.
Do you think that tab-indented input is a good design choice? Some people finds Tab hard to identify in a file, but it is easy to generate via script and don't need to be escaped like other delimiters such as comma or colon.

(16-08-2020, 07:34 AM)venam Wrote: The result is a file that's quite big, with 540K lines. xprompt still works perfectly though!
My file that feeds xprompt is 3.4MB. It contains all commands, all man pages (listed after xman, a script that opens a pdf of a manpage with zathura), all mpc commands and songs. And it also opens really fast. I had the idea to write a option to cache the stdin into a file that xprompt could read faster (although I'm not quite really willing to do it...).

You can also show the descriptions of options with xprompt.
Just write the description after the option separated by a tab, and it will list the descriptions after the items. I use it to show description of manpages when listing them.


Messages In This Thread
RE: What are you working on? - by movq - 16-08-2020, 03:54 AM
RE: What are you working on? - by venam - 16-08-2020, 07:34 AM
RE: What are you working on? - by seninha - 16-08-2020, 09:48 AM
RE: What are you working on? - by venam - 16-08-2020, 10:03 AM