Score:1

Add custom keyboard shortcut to any action in any app?

it flag

I would like to create keyboard shortcuts to my web browser for

  • Close tabs to left
  • Close tabs to right
  • Close other tabs

In Mac OS I know there is a place in the system settings to change this. I am new to Ubuntu and wondering how I can accomplish this same functionality?

Score:1
pl flag

Ridiculous answer for three examples.

  • Close other Tabs.

Highlight the Tab you want to keep. Use a shortcut 'Move tab to left'
Control+Shift+PgUp Repeat until the tab goes first position.

  • Close Tabs to right.

Then select Tab to right Control+PgDn

Close Tab (Repeat this until the tabs are all closed) Control+W


  • Close Tabs to left.
  1. Select tab to left Control+PgUp

  2. Close Tab Control+W

Repeat 1 and 2 alternatively until all the tabs you want are closed.

Score:0
cn flag

Not obviously, unfortunatelly.

You have to distinguish between global keyboard shortcuts and application specific keyboard shortcuts. You are currently asking about the latter.

Global shortcuts take precedence, and will override the application specific keyboard shortcut if defined. You can set global shortcuts in "Settings - Keyboard shortcuts". You can change predefined ones, or set your custom shortcuts.

The extent by which you can redefine application specific shortcut keys depends on the application. Some applications, such as LibreOffice, expose settings allowing you to change them. For other applications, it is sometimes possible to change shortcuts in the configuration files. In yet other cases, there is no other possibility to change shortcuts than edit the source code of the program and recompile.

Firefox, apparently like any other browser out there, does not allow for customization of shortcut keys. There used to be extensions that allowed to change some of them, but these are broken.

I know this answer is disappointing. I hope, with you, that a better answer comes around, but I do not think so. That is why I posted mine.

Richard Gove avatar
it flag
Thank you! That is disappointing, but at least I know. PS I've found one extension for FireFox that partially works, allows ALT+W to close other tabs, but its shortcut for Close Left and Close Right don't work. It's just called Close Tabs Shortcuts
vanadium avatar
cn flag
Thank you for the hint: I also installed the Close Tabs Shortcuts extension. In the extension manager, click the cog wheel then select "Manage extension shortcuts". I was able to change these shortcuts to ALt+L and Alt+R, respectively. The dialog warns when you try to assign a shortcut that is already in use.
Richard Gove avatar
it flag
Thank you! That's exactly what I need for now, shame you can't add other menu items like in iOS
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.