DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Web search as default when no entry was found?  (Read 5,484 times)

highend01

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 188
Web search as default when no entry was found?
« on: July 10, 2011, 05:33 PM »
Hi,

is there any way to use the current text as a web search phrase if no result was found?

Of course without any additional modifiers or by putting something like search in front.

I've used launchy for a long time and I'm used to this feature that you can type in anything
and as long it's not a valid search result it will open the phrase in the current web browser
by hitting enter at the end of the line ;)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Web search as default when no entry was found?
« Reply #1 on: July 11, 2011, 08:26 AM »
From the help file, this is a bit tricky but it can be done:

You can now create a special alias called noresults.

If user hits enter when no results are shown, this alias will be triggered.

It can be useful if you want to do something like launch what they type directly (as if it was on path), or invoke another search program, etc.  Just use $$1 in the results.

Important: you need to set the regular expression pattern to:
^noresults (.*)$

So if you wanted to do a web search your result would be just:
http://www.google.com?q=$$1 or http://www.google.com?q=$$u1

(the u1 is for better url encoding of the parameter)

or if you wanted to show the web search inside farr's window use result
igo http://www.google.com?q=$$u1

highend01

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 188
Re: Web search as default when no entry was found?
« Reply #2 on: July 11, 2011, 09:06 AM »
Thanks a lot, mouser :)

Adding this alias works as expected now.

Maybe you could add a little visual tweak to farr to make this special kind of use a bit smoother?

If you type a longer searchstring (e.g.: windows 7 registry hide user) the status bar of farr flickers a lot after you've reached the "7" because no results were found and with every additional letter that you type the statusbar switches between: Found 0 results in 0 seconds. | the directory in which farr is actually searching.

Maybe a user definable delay between 2 keystrokes after farr got two "found 0 results" in a row? Basically something like the "delay search start based on inter-keypress interval and length of search string" for this special kind of purpose?

Tia,
highend

Josh

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,411
    • Gathering Badge
    • Official Forum Clown
    • Coding Snacks
    • Plugin Coding Medal
    • Volunteers/Staff
    • Military Service Badge - US Army
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Web search as default when no entry was found?
« Reply #3 on: September 13, 2012, 05:10 PM »
Mouser, perhaps this should be a configurable option that enables/disables this functionality? With this, I can now totally replace the run dialog as I use it!
Strength in Knowledge

Original address: https://www.donationcoder.com/forum/index.php?topic=27276.0