GNOME Bugzilla – Bug 97725
dynamic mapping of windows to keys
Last modified: 2020-11-07 12:36:38 UTC
This is a enhancement request to implement a simple method to dynamically map a window to a key shortcut. Metacity proposes several ways to cycle through the windows but none of them is really efficient if you have several opened windows. In my own case, I noticed that I have often more than 10 windows opened but I hardly use more than 2 or 3 at the same time. I propose to implement a method to dynamically associate a window to a keystroke. I see 2 possible implementations: (1) create a large number of shortcuts. <n> represents a number. - 'map_<n>' is a window shortcut to map the window to the number <n> - 'select_<n>' is a global shortcut to select the window previously mapped to number <n> (2) create only 2 shortcuts. - 'map_window' is a window shortcut. It opens a dialog asking for a key (or an ascii character) to which the window will be mapped. - 'select_mapped_window' is a global keystroke It opens a dialog with a list of all mapped windows with their respective key defined in 'map_window'. The user then have to press the proper key to select a window. Example with 'map_window' is <Shift><Alt>Space and 'select_mapped_window' is <Alt>Space (a) Map a window to 'x' - give the focus to the window you want to map (e.g. an xterm) - press <Shift><Alt>Space. A dialog asking for a key should appear. - press the key 'x' (b) Select the window previously mapped to 'x' - press <Alt>Space - press 'x' My preference goes to the second solution. It is probably more difficult to implement but it is also more flexible and requires less shortcuts. In both implementations, the key mapped to a window could be displayed in its title.
What if you pressed Alt+Tab and a number appeared by/over each window (or by each window's icon in the tab popup, or both) and you could then press that number to jump straight to the window. So there would only be three keypresses: Alt Tab N If people have to make up their own bindings and then remember them I doubt most would bother. It's a feature that could use some test patches to experiment with and see if it works in practice.
That could work if the shortcut in Alt+Tab is statically allocated. If it is not, having a 'moving' shortcut does not really help if you have a lot of windows. The main purpose of my request is to not have to identify the window. Numbers 0-9 are not enough. A-Z could also be used. Alt+Tab could also provide a method to set/swap shortcuts. For example with Ctrl+N. btw, I got this idea of dynamic shortcut from ratpoison; a simple WM withou windows. All windows are fullscreen and all actions are performed via keyboard shortcuts.
The shortcut assignment could perhaps be based on window position, which would mean that if you usually log in and use the same arrangement of windows you'd always get consistent shortcuts. (Better than basing them on say order in which windows were launched)
marking low for now
*** Bug 170549 has been marked as a duplicate of this bug. ***
Created attachment 130251 [details] Bookmarking script Here's a simple Perl script as a first try towards this behaviour.
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old feature requests in Bugzilla which have not seen updates for many years. If you still use metacity and if you are still requesting this feature in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/metacity/-/issues/ Thank you for reporting this issue and we are sorry it could not be implemented.