xmodmap and gnome

GNOME (gnome-settings-daemon) was supporting custom xmodmap files for ages – as a convenient way to tweak the kbd config. I heard several times about people using that feature – even though it was never important, used by minority. Yesterday that feature has gone from g-s-d.

Since I feel that at least rudimentary xmodmap support is necessary, I made libgnomekbd load $HOME/.xmodmap if it exists. Hope it won’t be much trouble for people to change their configs.

Actually, I would be interested to hear here in comments about the ways people use xmodmap with gnome.

The discussion on IRC was quite hot. My apologies for some bad words, lads – I did not control myself well enough. Even though that does not eliminate my points about importance of xmodmap – and in general about our (GNOME) attitude to features used by minorities. Minorities matter. 99% = 99*1%

Bastien, my 30 lines are MUCH simplified version of those mighty 500 lines, not really equivalent – just allows to do the same thing, without gui, flexibility and stuff…

About xinitrc – that’s not an option, because xmodmap have to be reapplied after every xkb reconfiguration. First, at the session startup it has to be done after(!!!) g-s-d reconfigured xkb. And when user changes kbd configuration in g-c-c – xmodmap settings (if exist) have to be reapplied after every xkb config change, made by g-s-d.

Wait, does this mean that my X-25M SSD under Ubuntu will be able to lose another fraction of a second of boot time?! All I’ve got to do then is benchmark nVidia versus Nouveau boot times, pick the faster one, install CoreBoot, and use BootChart and BUM to cut out the wasted cycles, and ensure that my SSD is TRIM’d… maybe I can finally get down to 4 seconds!

One useful way of using Xmodmap files in gnome is strange people like me who like the dvorak layout but lives in a country which is not-native-english. At the times I have to communicate with my fellow countrymen, I need access to the extra swedish characters. I’ve used Xmodmap in the past to add them to the dvorak layout (on an alt-gr combo).
(Some might ask why I’m not using “svorak” which is supposed to be the “swedish dvorak”, but that layout is just too fucked up and takes away most of the benefits with dvorak for me.)

My Thinkpad comes with two extra keys above the left and right arrow keys, which usually map to “previous page” and “next page” in a web browser.

The problem is that they are *very* easy to press as a mistake — which often moves you away from a long answer you were typing, and makes you lose everything. (Lenovo has since fixed the problem by making those keys be recessed in newer models)

My solution is to use Xmodmap to map those keys to something else.

I have also used Xmodmap to map the “Thinkvantage” button (a big blue button that is supposed to open Lenovo’s website or something) to some function key (F40? I don’t remember) so I could use it with Compiz’s “scale” plugin.

I have a ~/.xmodmap and I toggle between dvorak and a Finnish layout. Preserving all the mods is an important feature for me.

I have mapped alt-gr to control and the extra key Finnish keyboards have next to the left shift to escape. Emacs and vim are a lot more ergonomic that way, reaching for the old escape and controls was killing my small hands. Plus I have swapped backspace and caps lock, as any sane person should.

I used to use a .Xmodmap file to switch 2 keys on my macbook keyboard which are badly mapped in the default macbook keymap. However, I’ve been meaning to look into fixing this properly for a week now. Now there is one more reason to do this
For what it’s worth, here is my old .Xmodmap
keycode 49 = less greater lessthanequal greaterthanequal
keycode 94 = at numbersign

I use an X mod map to remap CapsLk as A, and a few other usability tweaks. I always found the GUI “selector”(?) convenient, but I would be alright with editing gconf keys manually or with a separate applet (keyboard applet is a logical place, in my mind).

I use an xmodmap for my Apple Keyboard to completely disable NumLock (swap it for the Clear key symbol) and force the keypad to be permanently numeric so it works more like the mac keyboards that I used my whole computing life. Gnome’s keyboard settings don’t seem to offer this functionality so I stick with xmodmap.

Thank you very much for this patch. I have a…very nonstandard keyboard (122 key IBM terminal keyboard modified to hook up to a standard PC), and i have yet to actually figure out how to write proper xkb code, so i’ve been manually loading an xmodmap file this whole time. This patch gets rid of that ‘manual’ step quite nicely.

I use ubuntu 10.04 with gnome and xmodmap for various minor but essential usability tweaks, most notably the Previous/Next keys on Thinkpad/Lenovo keyboard already mentioned by someone above.

Personally, I hated the magical popup xmodmap selector. To me, it is a proof Gnome is going Windoze. I prefer plain text config files and plain text documentation that can be actually found somewhere. Magical “fool-proof” dialog boxes are not searchable by Google, as Page Rank performs poorly on highly structured (internationalized!) source code.

To sum up: I’m happy for the selector being removed and for the ~/.[xX]modmap (hardwired whichever way) being added. Just make sure to have a plain text documentation somewhere online! (Generally, gnome is rather poor in this respect in my opinion.)

However, I’m experiencing rather weird behaviour of Gnome for months (and certainly both before and after the critical October day): every now and then, my custom xmodmap setting gets lost. I can quickly restore it manually by running “xmodmap – < ~/.Xmodmap" but that's extremely annoying.

I still absolutely don't know what triggers the xmodmap being lost. I don't know how to Google for this irregular behaviour. I don't know what gnome-settings-daemon is supposed to do and it could be messing up my xmodmap settings…