2

I want to create a shortcut in Ubuntu which would open new tab and search for selected text in Firefox. For example, if I get some error I would select it press the shortcut and the new search would be opened.

I would add shortcut through Settings -> Keyboard Shortcuts. I know that I can open new tab through:

firefox --new-tab --url about:newtab

What I do not know is how to copy selected text or in other words what command does Ctrl+C execute? And how do I combine them?

Thanks!

4
  • I mean I could, but why? I am already using select + Ctrl+C + Ctrl+T + Ctrl+V + Enter, and I am finding that I use that combination a lot of times, so why not automate. I tried to enter a combination of shortcuts but it does not accept. I could also make a python script that would be run on the shortcut press but that would be just a hassle.
    – James Bond
    Jul 21, 2020 at 19:06
  • Ctrl-C is used to interrupt the current process, it doesn't "run a command". Read man kill signal stty
    – waltinator
    Jul 21, 2020 at 19:17
  • Okey, I can edit the post to correct it. I am not searching for some specific way but rather for a way to make this combination of actions (search selected in new tab and switch to it) possible. Thanks!
    – James Bond
    Jul 21, 2020 at 19:26
  • 1
    Some clipboard managers (klipper for instance) can run "actions" on clipped items.
    – xenoid
    Jul 21, 2020 at 19:41

1 Answer 1

0

Ctrl+C doesn't actually run any command. It sends SIGINT, i.e., Interrupt signal to the process running in foreground.

From Signal (IPC) - Wikipedia:

SIGINT

       The SIGINT signal is sent to a process by its controlling terminal when a user wishes to interrupt the process. This is typically initiated by pressing Ctrl+C, but on some systems, the "delete" character or "break" key can be used.

If you want to copy text from terminal, you should use Ctrl+Shift+C.

1
  • Thanks, interesting. Can I somehow combine Ctrl+Shift+C with commands to launch new firefox tab with the selected text searched, and then pres just one shortcut?
    – James Bond
    Jul 21, 2020 at 19:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .