Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: ability to use custom search engine for "Search on Web" (hardcoded to Google) #2088

Closed
ElijahLynn opened this issue May 12, 2022 · 4 comments

Comments

@ElijahLynn
Copy link
Contributor

The "Search on Web" feature is very useful. I recently switched to a non-Google search engine and noticed that Guake is hardcoded to use Google. It would be nice to have this be user customizable.

guake/guake/callbacks.py

Lines 50 to 58 in 2cfc9b3

def on_search_on_web(self, *args):
if self.terminal.get_has_selection():
self.terminal.copy_clipboard()
clipboard = Gtk.Clipboard.get_default(self.window.get_display())
query = clipboard.wait_for_text()
query = quote_plus(query)
if query:
search_url = f"https://www.google.com/search?q={query}&safe=off"
Gtk.show_uri(self.window.get_screen(), search_url, get_server_time(self.window))

guake/guake/guake_app.py

Lines 1323 to 1336 in 0db8148

def search_on_web(self, *args):
"""Search for the selected text on the web"""
# TODO KEYBINDINGS ONLY
current_term = self.get_notebook().get_current_terminal()
if current_term.get_has_selection():
current_term.copy_clipboard()
guake_clipboard = Gtk.Clipboard.get_default(self.window.get_display())
search_query = guake_clipboard.wait_for_text()
search_query = quote_plus(search_query)
if search_query:
# TODO: search provider should be selectable.
search_url = f"https://www.google.com/search?q={search_query}&safe=off"
Gtk.show_uri(self.window.get_screen(), search_url, get_server_time(self.window))

@PhantomLel
Copy link
Contributor

can i take this?

@oewami
Copy link

oewami commented Aug 16, 2022

yes.

@Davidy22
Copy link
Collaborator

If you want to work on resolving an issue, you can just send in a PR and if it works and looks good I'll merge.

@hackedd
Copy link
Collaborator

hackedd commented Nov 22, 2022

Added with #2134.

@hackedd hackedd closed this as completed Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants