Tomas-M / xlunch

Graphical app launcher for X with minimal dependencies
http://xlunch.org
GNU General Public License v3.0
219 stars 35 forks source link

Tab completion #7

Closed elpraga closed 7 years ago

elpraga commented 7 years ago

Would it be possible to add TAB completion as in BASH, so that it would complete the command name even if it is not listed in the config file? It would be really helpful, because I want to use it to replace fbrun from fluxbox for my wife, but the genconf command did not generate some even basic programs like firefox or openshot and it might be hard for me to hunt all of them by hand.

The expected behavior could be not showing any icons, just completing the command name in the input field (possibly cycling through possible completions when multiple completions can be found)

BTW it looks really neat! Thank you for writing it!

One small question. Why the name xlunch instead of xlaunch? Is it any kind of a joke referencing extra lunch? I was just curious..

Tomas-M commented 7 years ago

yes it's a joke :)

Regarding bash completion, that is good idea, but I do not know how to implement it.

genconf searches for *.desktop files in /usr/share/applications, and it uses only apps if they have 48x48 icon. So maybe you're just missing icons for your apps with that size. You can edit the genconf script to make it look for different icon sizes and then run xlunch with -i parameter to specify your icon size.

elpraga commented 7 years ago

Unfortunately I don't know how to implement it whey either, so I'll just edit the file by hand and I'll see if I can cover all cases, because xlunch is really neat.

Could this issue stay open with a tag help needed or similar and maybe someone else will be able to help?

elpraga commented 7 years ago

I just had an idea for the completition. Would you be able to look at fbrun from fluxbox @Tomas-M ? It's a really small launcher; it's only functions are history and b tab competition. It could be found at Fluxbox.

Tomas-M commented 7 years ago

I looked into fluxbox source codes, fbrun is a part of fluxbox. There are two tabCompletitions - history complete and application complete. First one completes from history (probably stored in a file) and second one simply parses PATH env variable and tries to find matching file names in all the PATH directories.

I think I cannot reuse the code directly since it is written in C++, not C, I'm not sure if these two are somehow compatible, I am not any C/C++ programmer :-) I think both history completion and app completion make sense, at least the command completion should be doable.

Currently I am not in the mood of implementing this. Patches welcome :)

elpraga commented 7 years ago

Unfortunately, u haven't written a single line of C/C++ code in my life. So I can't help with a path.

I was hoping this example could help..

Happy New year!

Tomas-M commented 7 years ago

I'm closing this since tab completion will not be implemented any time soon.