anyrun-org / plugin-websearch

Plugin to search with your preferred search-engine
GNU General Public License v3.0
1 stars 2 forks source link

Custom config for search engine stops at '&' #1

Open Vagahbond opened 8 months ago

Vagahbond commented 8 months ago

I tried configuring this plugin to search stuff on nix packages repo.

Config(
  prefix: "?",
  engines: [
    Custom(
      name: "google",
      url: "google.com/search?q={}",
    ),
    Custom(
      name: "nix packages",
      url: "search.nixos.org/packages?query={}&channel=unstable",
    ),
  ],
)

Code above works, but the "channel=unstable" part is ignored.

When doing this :

Config(
  prefix: "?",
  engines: [
    Custom(
      name: "google",
      url: "google.com/search?q={}",
    ),
    Custom(
      name: "nix packages",
      url: "search.nixos.org/packages?channel=unstable&query={}",
    ),
  ],
)

It does not work with the query.

I believe the string is truncated when finding a &.

FromWau commented 1 month ago

Hi @Vagahbond, I opened a PR that fixes your issue. I don't know if your problem still bothers you, but you can check out my fork with the fix and build it yourself. Fork: https://github.com/FromWau/plugin-websearch/tree/main

Instructions if u need them:

  1. git clone https://github.com/FromWau/plugin-websearch.git ~/plugin-websearch
  2. cd ~/plugin-websearch
  3. cargo build --release
  4. copy the .so to your dots -> cp -p ~/plugin-websearch/target/release/libwebsearch.so ~/.config/anyrun/plugins/
Vagahbond commented 1 month ago

Hi, thanks for notifying me, I will check that when I see my computer again

Vagahbond commented 4 weeks ago

Hey, so using your fork as a flake input for my anyrun config the issue is effectively fixed !