Opening selected text from anywhere in a browser to go to the URL or do a search with Ubuntu 18.04

The ability to create arbitrary commands and give them a shortcut is built into Ubuntu. Even better than the old Mac OS services menu, really.

Open Settings ┬╗ Keyboard. It will show a long list of keyboard shortcuts.

Scroll to the bottom and press the + sign.

Here’s what i typed in:

Name: Open text in browser Command: firefox -new-tab about:newtab Shortcut: Alt + W

Thanks to via

Despite my name, though, that doesn’t actually open the text in a browser. It completely ignores the selected text, and just opens a new browser window!