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.
|
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)) |
|
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)) |
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
guake/guake/guake_app.py
Lines 1323 to 1336 in 0db8148