GNOME Bugzilla – Bug 570817
Allow the keyboard shortcuts dialogue to include shortcuts to external scripts
Last modified: 2009-02-17 19:47:13 UTC
I am suggesting a keyboard shortcut that walks through workspaces just like the famous "Move between windows, using a popup window" does. All workspaces would be accessible with one shortcut, so you don't have to think where you want to go and select the shortcut for left/right or workspace number. This is especially useful when you have only two workspaces. Then it's always the 'other' workspace where you want. Other information:
This functionality is provided by the window manager. Moving to metacity.
Created attachment 128195 [details] metacity-walk-workspaces Here's a script to do just that. Save it in ~/bin, "chmod a+x" it, and use gconf-editor to set /apps/metacity/keybinding_commands/command_1 to the name of this script, and /apps/metacity/global_keybindings/run_command_1 to whatever keystroke you want to use to do it. (Note that this script ignores unpopulated workspaces; it would be easy to make it not do so, but I thought from your description that that's what was wanted.)
I think that makes this FIXED, then?
Not really. I can live with this script for now, and thanks for providing it. But a first class solution would be to actually make it configurable in the keyboard shortcuts dialog, standing next to the other workspace switching options or replacing some of them. Who decides if things like this are included? Here are further suggestions for the behavior of this functionality: Add a popup window that shows the names of the workspaces and the icons of the windows on them, similar to Alt-Tab showing the names and icons of the windows. And sort the workspaces by last usage like Alt-Tab does with windows. And don't ignore unpopulated workspaces. I don't know enough Perl and such to add this to the script. I hope someone reads this now that this bug is marked FIXED.
I read all the comments on all the Metacity bugs. I doubt very much that something like this will be made part of default Metacity, but that's not a big deal, since external scripts are quite capable of containing popup switchers as well. It seems to me that the reason you're saying that this isn't FIXED is that this isn't present in the keyboard shortcuts dialogue. So, since you're asking not for a change in Metacity but for a change in gnome-control-center, I'm going to have to send this one over to the gnome-control-center folks and retitle it accordingly. gnome-control-center folks: what would be needed to fix this, I think, is the ability to list a well-defined set of external scripts in the dialogue as bound to particular keystrokes using the "run_command_n" gconf keys. I could probably write this if you wanted, but is it something you'd consider?
In case I was unclear: I did not mean adding a choice of several configurable scripts to the keyboard shortcuts dialog. I meant adding just this one function, in the same way as there are "Switch to workspace 1/2" and "Switch to workspace on the left/right", because it saves some unnecessary thinking, as described above. Additionally, if you assign Control Tab to it, like I do, it is very easy to type with only the left hand; easier than the default shortcuts for "Switch to workspace 1/2" and "Switch to workspace on the left/right", or anything else I have tried for these.
But: * I am not going to add this into vanilla Metacity, because it can be adequately done with a script; * What appears in the keyboard dialogue is not a Metacity problem but a control-center problem. -- hence my retitling of the bug.
That kind of configurability is probably too much for the keyboard shortcuts dialog. It's ok that it can be done in gconf-editor. The only thing I'm worried about is that I have to maintain this script and install it on all my new installations. Is there a way to include it in Gnome? Are other scripts like this already in Gnome?
A few similar scripts have come up over time on the blog, but they're not collected anywhere. Since they're all in Perl, what would you say to having a package "Metacity::Extras" in CPAN which gave you a command to turn on or off whichever ones you liked?
I haven't used CPAN in the past, but better have it there than nowhere. Later I can try to get it packaged for Ubuntu.
Sounds great to me. (Note that because these are EWMH scripts, they should work with any modern WM, not just Metacity.) Would you prefer a GTK or commandline interface for the command? (Or both?)
Interface? Is there something we haven't discussed?
I was assuming there'd be some way of saying which scripts you wanted to turn on and with which keys, to save you editing gconf directly.
Oh no, gconf-editor is fine.