Run the command xev
. In the xev window, press the AltGr key. You'll see something like
KeyPress event, serial 29, synthetic NO, window 0x6400001,
root 0x105, subw 0x0, time 966635535, (243,-207), root:(1891,26),
state 0x0, keycode 66 (keysym 0xff7e, Mode_switch), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
Note the keycode; since the key isn't doing what you want, you'll see something else (possibly Alt_R
) instead of Mode_switch
. You want to assign this keycode to Mode_switch
, which is X11's name for AltGr. Put the following command in a file called .Xmodmap
(note capital X
) in your home directory:
keycode 66 = Mode_switch
Additionally, you may need to assign a modifier to Mode_switch
, but if all that's happening is a keycode discrepancy there'll already be one. See Set the key for spanish eñe letter for more information.
Run xmodmap ~/.Xmodmap
to test your file. On many systems, including Ubuntu 10.04, this file is loaded automatically in the default Gnome environment. On other distributions or environments, you may need to indicate explicitly that you want to run xmodmap ~/.Xmodmap
when you log in.
The last time I tried it, GNOME-Shell (i.e., Metacity is important here, I suppose) was controllable with wmctrl
just fine. So you can add shortcuts calling wmctrl
to switch the workspace.
Be aware that it only knows about workspace 1
, 2
, ... -- so there might be some work involved before it behaves as you'd like it to.
(You could be better off with diving into GNOME-Shell's sources; the relevant parts here are written in Javascript and it could be fairly easy to get your keys the way you'd like them. I tried something similar with the keybindings of the window switcher Alt+Tab
thingy, I'm not actually sure if the workspace switching is accessible in a similar way; still it might be worth a look.)
No idea about Unity, though.
Best Answer
One of the really powerful things about GNOME 3 is the ability to use javascript-based addons to add functionality. Though I am not entirely sure this addon will completely fulfill what you're looking for, I imagine it is about as close as you're going to get.
Put Windows is meant to be a completely customizable implementation of compiz's put plugin.
Edit: I just realized how old this question was. Much has changed since the OP posted the question, but its spirit appears to still be relevant, and this answer should be helpful.