awesomeWM / awesome

awesome window manager
https://awesomewm.org/
GNU General Public License v2.0
6.4k stars 597 forks source link

show Hotkeys-Help with search or fuzzy finder (like telescope in nvim) #3963

Open actionless opened 1 month ago

actionless commented 1 month ago

Discussed in https://github.com/awesomeWM/awesome/discussions/3962

Originally posted by **DeepReef11** October 4, 2024 I think the help panel would be much more useful if it had at least a search function and even better if it could be a fuzzy finder.
kosorin commented 1 month ago

Maybe I could do that, or at least some very basic searching.

In my config, I completely rewrote the default awful.hotkeys_popup. It doesn't perform fuzzy searching, but a simple search is good enough for me.

It takes a query string, splits it by whitespace, and then tries to match every word in the descriptions and keys.

Matching keys is a bit tricky. The whole word must match exactly. For example, if the query is "sup", it wouldn't make sense to highlight every keybinding containing the "super" key. Another example is if there is a keybinding super + ⬅️, the user can find it by typing "super left".

So, when the awful.hotkeys_popup is shown, it could automatically call awful.prompt.run and highlight the keybinding descriptions as the user types. But I'm uncertain whether this aligns with awesomewm philosophy.

image

https://github.com/user-attachments/assets/29ccc95a-7ca8-4a73-a432-179886932c4e

actionless commented 1 month ago

yup, looks solid 👌😺

actionless commented 1 month ago

So, when the awful.hotkeys_popup is shown, it could automatically call awful.prompt.run and highlight the keybinding descriptions as the user types

you still need though to handle Escape key (and mb make it configurable to set on which keys it could be closed)