albertlauncher / albert

A fast and flexible keyboard launcher
https://albertlauncher.github.io
Other
7.24k stars 304 forks source link

Bug Report: web search trigger words that end in vowels do not work properly #774

Closed jcklpe closed 5 years ago

jcklpe commented 5 years ago

Source

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_18.04/ /' > /etc/apt/sources.list.d/home:manuelschneid3r.list"

Environment

v0.16.1

Steps to reproduce

I set a trigger word for wikipedia called "wiki" and I try typing it in and it does not trigger the search. Instead it just shows me a list of all my web searches and near the bottom is the wikipedia one. If I hit enter after typing in wiki it will just search wiki on whatever the top selection is for my web search list.

If I change the trigger word to "wik" it works. I noticed this behavior because I decided to put wikipedia up a the top of the websearch list so that I could search for it just by typing in a word and hitting enter. I was testing this out and I noticed that when I typed "harambe" it would switch to searching files whenever I hit the e. I tried this a couple of different ways and realized that the issue seemed to be whenver I stuck a vowel in there. So when I said "haramb" it would wiki search for haramb, but if I said "haramba" or "harambi" it would do a file search.

I turned on fuzzy searching for all the plugins that had it as an option so I was thinking... maybe that had something to do with it?

oops maybe I have misdiagnosed the issue

Just realized that I have a couple of examples that don't fit the vowel theory. Def to do a definition search on dictionary.com doesn't work. "define" though does. And "translate" for google translate works fine.

But changing wiki to wik did fix the issue and I don't know why.

I have already double checked to see if the issue is me not appending a space to the end of the trigger words.

Expected behaviour

to be able to search wikipedia using the keyword wiki

Actual behaviour

I am not able to do that.

ManuelSchneid3r commented 5 years ago

I cant reproduce this issue. The websearch trigger code is trivial. I dont think the issue is there. Do you have trigger conflicts? Albert has no conflict detecting mechanism. Conflicts will silently result in weird behavior. Do you have the wiki extension, whose trigger is "wiki" (note the space), enabled?

Further please post or at least check /home/manuel/.config/albert/org.albert.extension.websearch/engines.json

jcklpe commented 5 years ago

I think that might be it as both the wiki and wik keywords work despite me only setting wiki to "wik" after discovering this problem. When I use wiki it gives me the incorrect behavior and when I use wik it gives me the correct behavior. So maybe this is a problem of conflict or simply that the wiki plugin works differently than I would have expected.

I kinda made it so I can't access the albert settings though. I had hidden the icon using the gnome extension "icon-hider" but the list had gotten so long after dropbox registered and registered things that it was impossible for me to unhide it because the albert toggle was off screen and the extension didn't properly provide a scroll bar for such occasions. I went into dconf editor and deleted the "icon-hider" files but.... uh that seems to have made it forget all additional tray icons registered to my system tray other than other extensions which register themselves or system tools which I imagine the default rebuild of icon-hider knows to access.

Edit: NVM I remembered the gear icon on the albert interface.

So uh... not sure what to do about this. Is there a way to maybe make albert register it's tray icon, barring having to uninstall/reinstall?

Here's my web search config file:

[
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{64c4bc82-f250-4cb2-ab3c-bd06624654bc}.png",
        "name": "Wikipedia",
        "trigger": "wik ",
        "url": "https://en.wikipedia.org/wiki/Special:Search/%s"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{fe02ffc3-d45c-4ad8-ac2a-cdff28f3cd5f}.png",
        "name": "Go!",
        "trigger": "go ",
        "url": "http://www.google.com/search?q=%s&btnI"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{c0d0a74d-f10d-466d-8a58-4b85fa56b3a6}.png",
        "name": "Dictionary",
        "trigger": "define ",
        "url": "https://www.dictionary.com/browse/%s"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{b42e1c51-e11a-4a66-b678-951b7705d678}.png",
        "name": "Google Translate",
        "trigger": "translate ",
        "url": "https://translate.google.com/#view=home&op=translate&sl=auto&tl=en&text=%s"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{9122fad4-07ad-4df4-8c3d-ae5fb24ee756}.png",
        "name": "Google",
        "trigger": "search ",
        "url": "https://www.google.com/search?q=%s"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{f386e2b3-822b-4050-b3a7-af1d6dad3c51}.png",
        "name": "Youtube",
        "trigger": "video ",
        "url": "https://www.youtube.com/results?search_query=%s"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{d632eeb8-7f60-4773-86d6-341ce9f32ac0}.png",
        "name": "Amazon",
        "trigger": "shop ",
        "url": "http://www.amazon.com/s/?field-keywords=%s"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{d473d1c6-ccaa-430d-929f-ac24038685fb}.",
        "name": "Ebay",
        "trigger": "ebay ",
        "url": "http://www.ebay.com/sch/i.html?_nkw=%s"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{ca5c4473-281b-441f-8ff0-0ee00003b8f2}.",
        "name": "GitHub",
        "trigger": "gh ",
        "url": "https://github.com/search?utf8=✓&q=%s"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{1e975352-da21-48f9-9dc8-033d9f17c518}.",
        "name": "Wolfram Alpha",
        "trigger": "wolf ",
        "url": "https://www.wolframalpha.com/input/?i=%s"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{38a04230-861a-4943-b79c-39c24876a8a8}.png",
        "name": "Image Search",
        "trigger": "image ",
        "url": "http://www.google.com/search?q=%s&tbm=isch"
    },
    {
        "iconPath": "/home/david/.config/albert/org.albert.extension.websearch/{73079d8e-4873-4946-a8a4-98abcdca975b}.png",
        "name": "Thesaurus",
        "trigger": "thes ",
        "url": "https://www.thesaurus.com/browse/%s"
    }
]
jcklpe commented 5 years ago

Bingo! I went into the init file for the wiki python extension and changed it's trigger word and now everything works as expected. Thanks! Love your approach on this stuff it's really dope.

I'm using ueli on mac and windows currently but they don't have a proper linux port yet. They're built in Electron and I wish their stuff was more easily extensible in the way you've built stuff with python. If Ueli gets a linux port then I'll probably switch over to that so that I can have a consistent experience across OS but I really like your project and I think it's great and if you ever put out a multi OS version then I'm def switching to it full time as I think your implementation has been the most robust and yet simple I've seen. Thank again for all your work!