Bug 374637 - Need improvement in placement of keyword
Summary: Need improvement in placement of keyword
Alias: None
Product: krunner
Classification: Plasma
Component: webshortcuts (show other bugs)
Version: 5.8.5
Platform: Ubuntu Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: Alexander Lohnau
Depends on:
Reported: 2017-01-06 15:35 UTC by testplayer
Modified: 2020-10-11 07:36 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Note You need to log in before you can comment on or make changes to this bug.
Description testplayer 2017-01-06 15:35:46 UTC
To evoke Web Shortcuts, we have to specify the keyword in the beginning of the search. This is inconvenient since you might change your mind about searching your local hard drive to the web mid way. I would like the ability to specify the shortcut keyword anywhere in the search term with an escape sequence of one's choice. Something like DuckDuckGo's implementation of bangs would be ideal.
Comment 1 Alexander Lohnau 2020-06-13 06:44:18 UTC
You can do this, the changes are just not immediately applied in KRunner :-)

*** This bug has been marked as a duplicate of bug 391243 ***
Comment 2 Alexander Lohnau 2020-06-13 06:46:20 UTC
Whoops wrong tab :D
Comment 3 Alexander Lohnau 2020-06-13 14:15:18 UTC
While liking the idea of being able to configure them like DuckDuckGo's bangs or the Firefox "Search with ..." feature (@duckduckgo fin the Firefox search bar is the equivalent of duckduckgo: in KRunner).

But I am not sure about changing the syntax of the term which was strictly <shortcut><seperator><query> and has been around for a long time.

What do the others think?
Comment 4 D. Debnath 2020-06-13 15:11:03 UTC
I was the one who originally reported the bug, with a different email account and too lazy to reset the password, as I've forgotten the password to that account.

Anyway, replying to your question:

> But I am not sure about changing the syntax of the term which was strictly <shortcut><seperator><query> and has been around for a long time.

The syntax I'm asking for would still work for the current syntax. It would just extend the current syntax to also include:


I think allowing for more flexibility won't hurt any users who might be habituated to the current syntax, because it would still work.
Comment 5 Alexander Lohnau 2020-06-13 16:38:13 UTC
> <query><separator/symbol><shortcut><query-continuation>

Can you please give an example how a query would look?

I thought you wanted sth.like the duckduckgo bangs:
!google my cool query

Which you would currently do by:
google:my cool query
Comment 6 D. Debnath 2020-06-13 16:44:13 UTC
I want something like this:

!g my query
my query !g
my !g query

All of them should work and do the same thing. This is how DuckDuckGo works. You can try it out on DuckDuckGo. Being able to customize the indicator symbol (! in this case) would be nice.
Comment 7 Alexander Lohnau 2020-06-13 16:47:01 UTC
Funny, I didn't knew you could do it this way.
Comment 8 Alexander Lohnau 2020-06-13 16:59:21 UTC
And this sounds cool, but I would like to have feedback regarding this idea from other KDE people before trying to implement it.
Comment 9 D. Debnath 2020-06-13 17:00:48 UTC
Sure! Hoping for the best :)
Comment 10 Nate Graham 2020-10-02 16:41:50 UTC
Seems reasonable to me.
Comment 12 David Faure 2020-10-04 09:39:33 UTC
Git commit 21d7a0af5416bb2b2ae61df0a9e45b3e8e74df8b by David Faure, on behalf of Alexander Lohnau.
Committed on 04/10/2020 at 09:39.
Pushed by dfaure into branch 'master'.

Support DuckDuckGo bang syntax in Webshortcuts

M  +3    -0    autotests/kurifiltertest.cpp
M  +10   -2    src/urifilters/ikws/kuriikwsfiltereng.cpp

Comment 13 Alexander Lohnau 2020-10-11 00:49:34 UTC
Git commit 84b547914741e6f6754388cae85cafd67ec2a9a8 by Alexander Lohnau.
Committed on 11/10/2020 at 00:47.
Pushed by alex into branch 'master'.

Allow syntax for DuckDuckGo bangs in Webshortcuts
FIXED-IN: 5.21

M  +17   -7    runners/webshortcuts/webshortcutrunner.cpp
M  +1    -0    runners/webshortcuts/webshortcutrunner.h

Comment 14 Nate Graham 2020-10-11 02:07:30 UTC
Is this all implemented now?
Comment 15 Alexander Lohnau 2020-10-11 07:36:29 UTC
Yes :)