Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been using xmodmap to replace my Caps Lock key with Control for a few years now. However, every since I upgraded to Ubuntu 11.04 it seems to have stopped working. I'm using Gnome in combination with xmonad.

I have the following in my .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 "---------------------"

Looking in .xseesion-errors, I can see that it is being executed:

/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)

---------------------

The last bit of output seems to show that Caps Lock has indeed been removed. However, when I hit the caps lock key it still turns caps lock on and off. If I now open a terminal window and rerun these commands, it will work fine.

What am I doing wrong?

Thank you

share|improve this question
    
Are you using Unity (default for 11.04), or did you install gnome2/3? –  pbsmind Jun 21 '11 at 17:48
    
You're using gnome. It's probably changing your keyboard after xmodmap does. –  Samuel Edwin Ward Apr 2 '12 at 19:09

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.