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 https://askubuntu.com/questions/254424/how-can-i-change-what-keys-on-my-keyboard-do-how-can-i-create-custom-keyboard/254442#254442 via https://askubuntu.com/questions/831135/shortcut-to-open-new-browser#831141

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!