Eu tenho usado o xmodmap para substituir minha tecla Caps Lock pelo Controle por alguns anos. No entanto, desde que eu atualizei para o Ubuntu 11.04, parece que parou de funcionar. Eu estou usando o Gnome em combinação com o xmonad.
Eu tenho o seguinte no meu .gnomerc:
## Set xmonad as our window manager
export WINDOW_MANAGER="xmonad"
## Set transparency effects
#xcompmgr -c -f -I 0.09 -O 0.09 &
xcompmgr &
## Set up display
python $HOME/bin/autodetect.py
## Load up xinitrc
$HOME/.xinitrc
## Synchronize clipboards
autocutsel -f
## Typing monitor
xwrits typetime=47 break=3 canceltime=5 +breakclock +clock -lock &
## Volume control
gnome-volume-control-applet &
## Start-up music player
aqualung &
## IM
pidgin &
## Start-up a web browser
google-chrome &
## Start-up IDE
emacs &
## Setup keyboard
echo "---------------------"
xmodmap -verbose
echo "---------------------"
xmodmap -verbose $HOME/.xmodmap
echo "---------------------"
xmodmap -verbose
echo "---------------------"
Olhando nos erros xseesion, vejo que está sendo executado:
/etc/gdm/Xsession: Beginning session setup...
trayer: no process found
Warning: Only changing the first 8 of 12 buttons.
Active screens: DVI-1, DVI-0
Setting known configuration: DVI-1, DVI-0
Refreshing system tray
Configuring trackball
synergys: no process found
2011-06-23T09:58:57 INFO: Synergy 1.3.6 Server on Linux 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64
/build/buildd/synergy-1.3.6/cmd/synergys/synergys.cpp,1098
2011-06-23T09:58:57 DEBUG: opening configuration "/home/eerez/etc/synergy.conf"
/build/buildd/synergy-1.3.6/cmd/synergys/synergys.cpp,1113
2011-06-23T09:58:57 DEBUG: configuration read successfully
/build/buildd/synergy-1.3.6/cmd/synergys/synergys.cpp,1124
2011-06-23T09:58:57 DEBUG: XOpenDisplay(":0")
/build/buildd/synergy-1.3.6/lib/platform/CXWindowsScreen.cpp,889
2011-06-23T09:58:57 DEBUG: xscreensaver window: 0x00000000
/build/buildd/synergy-1.3.6/lib/platform/CXWindowsScreenSaver.cpp,342
2011-06-23T09:58:57 DEBUG: screen shape: 0,0 3360x1050 (xinerama)
/build/buildd/synergy-1.3.6/lib/platform/CXWindowsScreen.cpp,131
2011-06-23T09:58:57 DEBUG: window is 0x00e00004
/build/buildd/synergy-1.3.6/lib/platform/CXWindowsScreen.cpp,132
2011-06-23T09:58:57 DEBUG: opened display
/build/buildd/synergy-1.3.6/lib/synergy/CScreen.cpp,41
2011-06-23T09:58:57 DEBUG: registered hotkey ScrollLock (id=ef14 mask=0000) as id=1
/build/buildd/synergy-1.3.6/lib/platform/CXWindowsScreen.cpp,717
2011-06-23T09:58:57 NOTE: started server
/build/buildd/synergy-1.3.6/cmd/synergys/synergys.cpp,515
2011-06-23T09:58:57 INFO: screen "eerez" shape changed
/build/buildd/synergy-1.3.6/lib/server/CServer.cpp,1157
---------------------
!
! executing work queue
!
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), 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)
---------------------
! /home/eerez/.xmodmap:
! 4: remove Lock = Caps_Lock
! Keysym Caps_Lock (0xffe5) corresponds to keycode(s) 0x42
remove lock = 0x42
! 5: remove Control = Control_L
! Keysym Control_L (0xffe3) corresponds to keycode(s) 0x25
remove control = 0x25
! 6: keysym Caps_Lock = Control_L
! Keysym Caps_Lock (0xffe5) corresponds to keycode(s) 0x42
keycode 0x42 = Control_L
! 7: add Lock = Caps_Lock
add lock = Caps_Lock
! 8: add Control = Control_L
add control = Control_L
!
! executing work queue
!
remove lock = 0x42
remove control = 0x25
keycode 0x42 = Control_L
add lock = Caps_Lock
add control = Control_L
---------------------
!
! executing work queue
!
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock
control Control_L (0x25), Control_L (0x42), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), 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)
---------------------
O último bit de saída parece mostrar que o Caps Lock foi de fato removido. No entanto, quando pressiono a tecla Caps Lock, ela ativa e desativa o Caps Lock. Se eu abrir uma janela de terminal e executar novamente esses comandos, tudo funcionará bem.
O que estou fazendo de errado?
Obrigado