On one machine running Debian squeeze, when I log in with a display manager (I tried xdm, gdm or kdm), none of my Sawfish key or mouse bindings have any effect. If I log in in text mode then run startx, everything works fine.

If I try fvwm, most bindings don't work either, but some mouse bindings do.

When I log in with a display manager, I execute a custom session that loads my ~/.xsession. That file is essentially . ~/.profile; . ~/.xinitrc, so my session should be exactly the same in both cases (same environment variables, same programs, etc.).

What is causing Sawfish and Fvwm not to recognize my bindings? How is using a display manager different from running startx? How can I make my bindings work?


I know what is ailing Sawfish, and how to fix it, but not why using a display manager causes this behavior.

My personal keyboard layout has no Num Lock key, and does not assign any key to the modifier Mod2. Sawfish ignores the modifier assigned to Num Lock when it starts. If no key is assigned to a modifier, Sawfish does not ignore it, so a binding for key is not triggered when Mod2 is on (there would have to be a binding for ).

Fvwm behaves similarly. There's an additional subtlety that bindings with A in the modifiers column work all the time, regardless of whether Mod2 is on; it's only the bindings with explicit modifiers set that don't work.

For some reason that I haven't figured out, when I log in with a display manager, the Num Lock modifier is recorded as on (even though it is off while I'm typing my user name and password, and the Num Lock LED on the keyboard is off). This causes Fvwm and Sawfish to receive Mod2+key keyboard events rather than the key that has a command bound to it.

Since I'm not using Mod2, I can fix this by turning off Num Lock in my .xsession:

python -c 'from ctypes import *
X11 = cdll.LoadLibrary("libX11.so.6")
display = X11.XOpenDisplay(None)
X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(16), c_uint(0))

or completely disable Mod2 with

xkbset nullify mod2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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