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.

I use xmodmap to alter my keyboard layout during session startup. However, each time the GNOME screensaver/lock screen is activated, it resets the keyboard to its default layout, and I have to run xmodmap again to get my keybindings back.

I understand that resetting the keyboard layout is the right thing to do before presenting a password prompt, but Is there a way to stop the GNOME screensaver from doing it? Or a way to tell GNOME to use a custom keyboard layout all the time?

share|improve this question

4 Answers 4

up vote 2 down vote accepted

At log in the .Xomodmap (set up as user or globally) would read properly but when the monitor goes to sleep, and I re-log-in, it would be reset and keys would work as before .Xmodmap was loaded. No setting worked around until at some point I realized that my keyboard is plugged in to the monitor and thus all sittings are lost when the monitor goes to sleep or is turned off. What helped was to plug in the keyboard directly to the computer tower. Now the initial reading of .Xomodmap at start up is maintained independently of the monitor being on or off.

share|improve this answer
    
Thanks, this was exactly the problem I was having too. –  Riccardo Murri Feb 23 '11 at 9:23
    
the problem reapeared when I had other things (mouse, webcam) plugged to the monitor--but works fine again since I plugged these to the computer or keyboard (via computer) –  user11243 Mar 15 '11 at 21:13

You can change GNOME keyboard layout options in System -> Preferences -> Keyboard.

You can edit key bindings in System -> Preferences -> Keyboard Shortcuts.

These may not have the same flexibility as xmodmap, but should work properly even after screensaver/lock screen.

share|improve this answer
    
Thanks for the suggestions. I forgot to mention in the question that I use xmodmap mainly to add accented characters to some modifier+letter combination. As far as I can see, this cannot be accomplished with the tools available in the menu. –  Riccardo Murri Aug 10 '10 at 18:57

I have custom key bindings stored in an xkb file, which I can load with xkbcomp. I have never experienced any problems with the screensaver resetting this config.

You can then put the xkbcomp command in your .xinitrc file to load the keymap whenever x starts.

share|improve this answer
    
Thanks! This would probably be the way to go if I were starting my keyboard layout edits now. However, I already have some quite extensive modifications in Xmodmap format and don't feel like spending an evening to convert the files... –  Riccardo Murri Aug 10 '10 at 18:59

Searching with gconf-tool, I found the setting /desktop/gnome/peripherals/keyboard/general/update_handlers, which apparently is a list of Xmodmap files to be (re)loaded each time the keyboard status is reset.

Settiing this to .Xmodmap made the thing work for me (after logging out and back in).

share|improve this answer

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.