Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I press my left Super key the gnome shell appears and when I press the right Super key it does not. Moreover pressing right Super + T does open a terminal at once, but when using left super I have to press the T twice, when I press the T only once it is similar to just pressing the T without holding Super left. This last point also occurs with other shortcuts that I defined (like Super+L, Super+E), but not with Super+Up/Down/Left/Right.

What I want is to press either Super key to get the gnome shell and to use either Super key in combination with T to open a terminal immediately (and similar with other shortcuts). I use Ubuntu 12.04 LTS and the gnome 3 shell.

share|improve this question
    
In Settings Manager -> Keyboard, is there an option like exo-open --launch TerminalEmulator? If so, what does it say in the second column, shortcut? –  DaimyoKirby Dec 19 '12 at 22:08
    
1) Do you mean the Keyboard section under system settings? If so I can't find it there. 2) If you mean the compiz settings-manager, I can't find it there either. Regardless, I tried your command in the terminal and it says that exo-open is not installed, so I highly doubt that option will be there. There is however the custom shortcut launch terminal with the command x-terminal-emulator. That is the one I use, since the default launch terminal does not seem to work. –  Erik Dec 24 '12 at 8:18
add comment

1 Answer 1

xmodmap solution

I think you can do this using xmodmap, a tool to modify keymaps. Since my keyboard does not have a right Super key I cannot confirm this solution, so please leave a comment if it doesn't work.
All steps are done in a terminal

Print the current modifier map
Run

xmodmap

This should print the current modifier map which should like something like this

xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock      
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

The important line is the mod4 line, this line shows which key codes are mapped to the Super_L and Super_R key symbols.

Backup the key map
Before we change anything it is a good idea to backup the current key map, we can do this with

xmodmap -pke > ~/.xmodmap.orig

Now if anything goes wrong you can simply type

xmodmap ~/.xmodmap.orig

to restore your original key map. (If you made some serious mistakes and you cannot properly type anymore, a reboot also works)

Check current key map for the Super keys
Assuming that the Super keys have consecutive key codes (0x85 and 0x86 in this case) we can check the current mapping by running

xmodmap -pke | grep -wA1 $((0x85))

were of course you should change the 0x85 by the key code you have from your modifier map. This should give you

keycode 133 = Super_L NoSymbol Super_L
keycode 134 = Super_R NoSymbol Super_R

( the $((0x85)) converts the hexadecimal number to decimal)

Copy the behavior of the left Super to the right Super
As you can see from the previous step the right Super key has key code 134 but we want it to have the behaviour of the left Super key which has keycode 133. We can do this by remapping the key using

xmodmap -e "keycode 134 = Super_L NoSymbol Super_L"

Checking if it works
If you now do

xmodmap -pke | grep -wA1 $((0x85))

you should see

keycode 133 = Super_L NoSymbol Super_L
keycode 134 = Super_L NoSymbol Super_L

meaning that both keys now have the same behavior. Also the modifier map should have changed on the line with mod4, we can check this by running

xmodmap | grep 'mod4'

which should give

mod4        Super_L (0x85),  Super_L (0x86),  Super_L (0xce),  Hyper_L (0xcf)

And of course the shortcuts which you mentioned should work too!

Make mapping persistent
If it works, you can make sure that these settings are automatically applied when you boot. Run

echo 'keycode 134 = Super_L NoSymbol Super_L' >> ~/.xmodmaprc

to store your custom key mapping in the file ~/.xmodmaprc. Run

echo 'xmodmap ~/.xmodmaprc' >> ~/.xsessionrc

to make sure the custom key map is executed when your window manager loads.

share|improve this answer
    
First of all thank you for your answer, I did everything up to Make mapping persistent. The output in the terminal was exactly as mentioned, however my problems remain the same: left super shows the gnome shell and the right one does not. And similar with shortcuts, with the left super, you'll have to press t twice to open the terminal and with the right super once is sufficient. –  Erik Jan 7 '13 at 15:34
    
hmm, then I'm also clueless :P I guess these shortcuts are handled on some deeper level. –  Gerhard Burger Jan 7 '13 at 17:54
    
Ah, I found a bug report, apperently more people have the same issue :) bugzilla.gnome.org/show_bug.cgi?id=659899 –  Gerhard Burger Jan 7 '13 at 17:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.