Hoboneer / .scripts

Helper scripts
1 stars 0 forks source link

dmenu_surfraw: implement query completions from the network #1

Open Hoboneer opened 3 years ago

Hoboneer commented 3 years ago

This requires API query completions to be implemented in mkelvis and co. See https://github.com/Hoboneer/surfraw-tools/issues/20.

As for how the available completions gets put to dmenu, maybe the script could check if a specific word is contained in the returned query, say, %%. I need to find a good one that:

  1. is fast (and easy) to type; and
  2. is an uncommon term that is very unlikely to conflict with an actual search term.

Maybe it could be configurable? DMENU_SURFRAW_COMPLETION_WORD? That's really long.

It should limit completion requests to once per 10 seconds--maybe 5. I'll have to look around for common timeouts (https://www.nzsl.nz seems to have one of 10 seconds; see https://github.com/ODNZSL/nzsl-online/blob/1a12f4db3c7ee2fb02860c51e9acf20384248570/app/services/autocomplete_search_service.rb#L5).

Hoboneer commented 2 years ago

Maybe it could optionally(?) require the incremental patch for dmenu.