Surfingkeys icon indicating copy to clipboard operation
Surfingkeys copied to clipboard

Search selected/entered via omnibar on background

Open eugercek opened this issue 1 year ago • 6 comments

Sometimes it feels natural to accumulate links in the background to read them later.

Solves #1757

Functionality is ready but I want to discuss defaults and some refactorings.

  1. What should be the default key for searching in the background? I choose ; because it's unlikely to someone assign searchAlias to ;. b for "background" is occupied by default and even if the user changes it'll probably clash with Baidu or Bing.

  2. Should we refactor? I think it's sufficiently hard to grasp which line adds what functionality in the current state. For o + alias like og for "Open Google" Control + Enter opens in background so one Omnibar is enough. But other parts have some repetitions, we can use some kind of builder, but to use a builder we need to change searchSelectedWith to something like searchSelectedWith(URL: string, options: {})

eugercek avatar Jun 30 '22 20:06 eugercek

Hi @eugercek ,

great work! regarding the defaults shortcut, I would prefer it to be accessible by the left hand. Frequently, we will be using the mouse to select some text before intending to background search. It will be faster to immediately trigger using the left hand.

Which letter key to use is tricky, because most seems to be used up by others.

Another option is to still use "s". But overload it. "sg" - search google in foreground. "sG" - search google in background.

I really like the idea above. Though I prefer the default to flipped. I search in background much more frequently.

"sG" - search google in foreground. "sg" - search google in background.

onguarde avatar Jul 26 '22 08:07 onguarde

Hi,

I would prefer it to be accessible by the left hand

Excellent point!

"sG" - search google in background.

sG is used for "Open OmniBar with selected text and search it new tab (not in the background)"

So we need to find another left-hand key. Using an alphabetic character is not OK since people can bind it to a search engine. Tilde is far from home row, but it's the only easy key to press with left hand.

So we could use both ; and ` for background.

I like the idea above. However, I prefer the default to flipped. I search in the background much more frequently.

I agree, but I don't want to break people's workflow; after this has merged, I'll use the below function to swap those.

function swapKeys(key1, key2, mode="map", mode_remove="unmap") {
  api[mode]("temp", key1);
  api[mode](key1, key2);
  api[mode](key2, key1);
  api[mode_remove]("temp");
}

eugercek avatar Jul 27 '22 20:07 eugercek

So we could use both ; and ` for background.

How about q?

brookhong avatar Jul 28 '22 01:07 brookhong

q is ok for ergonomics, but removing q as a search alias is a bit problematic. Can we bind the space key?

eugercek avatar Jul 28 '22 19:07 eugercek

Seems like this is still not implemented.

onguarde avatar Feb 15 '23 03:02 onguarde

Totally forgot this, will look at weekend.

eugercek avatar Feb 16 '23 00:02 eugercek