Further xmodmap and numlock woes

A while ago I wrote a post to this list about the problems that arose when I disabled numlock with xmodmap -e "clear mod2": http://www.haskell.org/pipermail/xmonad/2013-February/013493.html I ended up "fixing" the problem in the legacy application, so I didn't have to muck about with xmodmap. Or so I thought. Today it reared its ugly head again, once and for all telling me that I seriously need to _completely_ disable the numlock key. My first step was to upgrade xmonad to 0.11 and then I tried xmodmap -e "clear mod2" again and of course it still didn't work: My mod key was now non-functional again. /sigh Next step was to dig out the original suggestion from Adam: handleEventHook = ( \e -> case e of MappingNotifyEvent {} -> return (All False) _ -> mempty) I added the above to my xmonad.hs file and then it failed with this: Not in scope: data constructor `All' Not in scope: `mempty' I suspect I need to import something, but what? Here's my xmonad.hs file: https://gist.github.com/ThomasLocke/5196294 Am I missing some crucial parts? :o) Thomas Løcke ps. I found xmonad at github: https://github.com/xmonad/xmonad is this an official repository?

On Tue, Mar 19, 2013 at 9:59 AM, Thomas Løcke
Not in scope: data constructor `All'
Not in scope: `mempty'
I suspect I need to import something, but what? Here's my xmonad.hs file:
Data.Monoid has both. ps. I found xmonad at github: https://github.com/xmonad/xmonad is this an official repository?
No; some github worshipper took it on himself to fork xmonad onto github on the grounds that any project not on github is obviously dead and unmaintained and it was up to him to "save" it (this is very nearly word for word from the mailing list discussion!), but somehow nobody actually followed him along the path to salvation and it hasn't been updated since he did it. The official repo is still darcs at http://code.haskell.org/xmonad/ and http://code.haskell.org/XMonadContrib. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Tue, Mar 19, 2013 at 3:39 PM, Brandon Allbery
Data.Monoid has both.
Thanks! My xmonad.hs file now compiles without error, so YAY! Did it work then? Well, yes and no. It works if xmonad is already running, ie. I open a terminal and enter xmodmap -e "clear mod2". The numlock key is now disabled, so clicking it, even frantically, does nothing and my mod key is still fully functional. It doesn't work if I add "clear mod2" to my .Xmodmap file though and neither does it work if I call xmodmap -e "clear mod2" from .xinitrc. xmonad starts up, the numlock key is disabled but my xmonad mod key doesn't work. So a couple of steps forward, and then one back. Can something be done to Adam's original proposed solution, so it'll also handle me clearing mod2 from either .Xmodmap or .xinitrc before xmonad is started?
No; some github worshipper took it on himself to fork xmonad onto github on the grounds that any project not on github is obviously dead and unmaintained and it was up to him to "save" it (this is very nearly word for word from the mailing list discussion!), but somehow nobody actually followed him along the path to salvation and it hasn't been updated since he did it. The official repo is still darcs at http://code.haskell.org/xmonad/ and http://code.haskell.org/XMonadContrib.
OK, good to know. Thanks. :o) Thomas Løcke

On Tue, Mar 19, 2013 at 03:46:58PM +0100, Thomas Løcke wrote:
On Tue, Mar 19, 2013 at 3:39 PM, Brandon Allbery
wrote: Data.Monoid has both.
Thanks! My xmonad.hs file now compiles without error, so YAY!
Did it work then?
Well, yes and no. It works if xmonad is already running, ie. I open a terminal and enter xmodmap -e "clear mod2". The numlock key is now disabled, so clicking it, even frantically, does nothing and my mod key is still fully functional. It doesn't work if I add "clear mod2" to my .Xmodmap file though and neither does it work if I call xmodmap -e "clear mod2" from .xinitrc. xmonad starts up, the numlock key is disabled but my xmonad mod key doesn't work.
So a couple of steps forward, and then one back.
In that case, does it work if you add spawn "xmodmap -e \"clear mod2\"" to your startupHook? -Brent

The module you're looking for is Data.Monoid. I have never really understood xmodmap, and I suspect it's broken in a few ways. You can probably fix your problem by moving numlock to a different keysym, like this: xmodmap -e "keysym Num_Lock = F13" Marshall On Tue, Mar 19, 2013 at 02:59:25PM +0100, Thomas Løcke wrote:
A while ago I wrote a post to this list about the problems that arose when I disabled numlock with xmodmap -e "clear mod2":
http://www.haskell.org/pipermail/xmonad/2013-February/013493.html
I ended up "fixing" the problem in the legacy application, so I didn't have to muck about with xmodmap. Or so I thought. Today it reared its ugly head again, once and for all telling me that I seriously need to _completely_ disable the numlock key.
My first step was to upgrade xmonad to 0.11 and then I tried xmodmap -e "clear mod2" again and of course it still didn't work: My mod key was now non-functional again. /sigh
Next step was to dig out the original suggestion from Adam:
handleEventHook = ( \e -> case e of MappingNotifyEvent {} -> return (All False) _ -> mempty)
I added the above to my xmonad.hs file and then it failed with this:
Not in scope: data constructor `All'
Not in scope: `mempty'
I suspect I need to import something, but what? Here's my xmonad.hs file:
https://gist.github.com/ThomasLocke/5196294
Am I missing some crucial parts?
:o)
Thomas L cke
ps. I found xmonad at github: https://github.com/xmonad/xmonad is this an official repository?
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

On Tue, Mar 19, 2013 at 3:42 PM, Marshall Lochbaum
I have never really understood xmodmap, and I suspect it's broken in a few ways. You can probably fix your problem by moving numlock to a different keysym, like this:
xmodmap -e "keysym Num_Lock = F13"
Nope, that didn't work either. When I do the above my xmonad mod key goes puff, just like it does with clear mod2. xmonad really does not like it when I try to change one of the modx keys. :o) I've never had any problems with xmodmap before. I've used it countless times to change/disable keys, fix mouse buttons and whatnot. It has never seemed broken to me, and since the only problem I'm having is the death of my xmonad mod key, I rather suspect this issue is a matter of me getting my xmonad.hs file right.

On Tue, Mar 19, 2013 at 10:42 AM, Marshall Lochbaum
I have never really understood xmodmap, and I suspect it's broken in a few ways. You can probably fix your problem by moving numlock to a different keysym, like this:
Sort of broken. The problem is that modern X servers don't actually use xmodmap; they use Xkb, and that has certain modifiers "baked in" to its keymaps (notably caps and num lock) and you can only reliably alter that by rewriting the Xkb mappings. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (4)
-
Brandon Allbery
-
Brent Yorgey
-
Marshall Lochbaum
-
Thomas Løcke