[openbox] xmodmap causes openbox 3.5.x to stop responding, consume cpu cycles

Robbie Smith zoqaeski at gmail.com
Tue Apr 22 08:34:07 EDT 2014


On 21/04/14 14:30, Parke wrote:
> Hi,
> 
> When I run the following command on Openbox 3.5.2 on Ubuntu 14.04:
> 
> xmodmap -pke | xmodmap -
> 
> CPU usage spikes to 100% for 50+ seconds.  During this time, openbox
> does not respond to any mouse (or keyboard?) actions.
> 
> Running the same command in Unity uses about 2 seconds of CPU.
> 
> I believe this problem appeared some years ago with Openbox 3.5.
> 
> On a slower machine, running Openbox 3.4.10, when I run the above
> xmodmap command, openbox is sluggish (but still responds) for 10
> seconds.  During seconds 10-20, CPU usage is still 100%, but openbox
> is highly responsive.  After 20 seconds, CPU usage drops to normal
> levels.
> 
> Thanks,
> 
> -Parke
> _______________________________________________
> openbox mailing list
> openbox at icculus.org
> http://icculus.org/mailman/listinfo/openbox
> 

xmodmap is broken: don't use it. I don't recall the exact reason why or
how, but I used to get this all the time too.

Use xkb instead if you need a custom layout, you can roll your own
fairly easily without modifying any system files assuming that the
configs it's built on already exist (and they probably do, there are a
lot of layouts and options in there).

This is mine, for example:

~/.config/xkb/keymap/custom.xkb
default xkb_keymap "default" {
  xkb_keycodes  { include "evdev+aliases(qwerty)+fixes(insert)"       };
  xkb_types     { include "complete"    };
  xkb_compat    { include "complete"    };
  xkb_symbols   { include
"pc+us+inet(evdev)+capslock(thirdlevel)+vimkeys+compose(ralt)+keypad(oss)+keypad(pointerkeys)"
 };
  xkb_geometry  { include "pc(pc104)"        };
};

That will load a US keyboard layout, with
- Caps Lock set as a third level chooser
- Vim-style arrow keys on H J K L
- Compose key on my right alt
- Extra mathematical symbols on my number pad
- Pointer keys using the number pad

I think I've also got a bit in there to fix up my insert/print screen
keys which my laptop keyboard gets backwards.

I load it with the following command which I've put in a session
autostart script so it's desktop-agnostic.
$ xkbcomp -I /home/robbie/.config/xkb/
/home/robbie/.config/xkb/keymap/custom.xkb ${DISPLAY%%.*}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1031 bytes
Desc: OpenPGP digital signature
URL: <http://icculus.org/pipermail/openbox/attachments/20140422/08cf28de/attachment.sig>


More information about the openbox mailing list