You are not logged in.

#1 2010-07-13 04:41:28

mk12
Member
Registered: 2010-07-06
Posts: 16

[SOLVED]Xmodmap not working?

I have an apple aluminum keyboard. All of the media keys are mapped to the various XF86's except two: the Expose and Dashboard keys. I created an /etc/X11/Xmodmap mapping their keycodes to XF86LaunchA and XF86LaunchB, and executed 'xmodmap /etc/X11/Xmodmap'. Then in the CompizConfig Settings Manager, I made the keys start Scale and Expo respectively. It works fine, but when I restart, or logout and log back in, there's two problems:

1. I have to manually xmodmap /etc/X11/Xmodmap. So what file do I edit to do it automatically? I was going to use /etc/gdm/Init/Default (where I also turn on numlock and calibrate my display, which always work), but I looked and it already executes 'xmodmap /etc/X11/Xmodmap' if the file exists. But yet when I log in, it's not mapped (but the display has been calibrated). Why? Help?

2. After I map the keys with xmodmap, it STILL doesn't work: the only way to make it work (for both Scale and Expo) is to clear the key in the CCSM (or the gconf editor) and then set it back to what it already was, XF86LaunchA (and B). Why do I have to do this? I could of course (after figuring out which file to do this, apparently not /etc/gdm/Init/Default ?) use the gconftool-2 to do this on every login, but that feels like an ugly hack. There must be a reason why this isn't just working.

If you have any idea what's causing this or maybe something I should try please reply. Thanks.

Last edited by mk12 (2010-07-13 19:31:59)

Offline

#2 2010-07-13 11:30:29

Mektub
Member
From: Lisbon /Portugal
Registered: 2008-01-02
Posts: 647

Re: [SOLVED]Xmodmap not working?

mk12,

I use an initialization file called $HOME/.Xmodmad.

Normally I don't use any DE, so I have to explicitly load it with xmodmap $HOME/.Xmodmap from my startup script.

But for users using Gnome, the first login after the creation of .Xmodmap asks if it should load it, and after that it will
be loaded automatically.

Somewhere along the gnome startup there must be  a test for the existence of this file, but I never bothered to find out.

Mektub


Follow me on twitter: https://twitter.com/johnbina

Offline

#3 2010-07-13 15:13:18

mk12
Member
Registered: 2010-07-06
Posts: 16

Re: [SOLVED]Xmodmap not working?

So it has to be ~/.Xmodmap, not /etc/Xmodmap? I am the only user but.. it just makes more sense for it to be system-wide tongue. But I'll try moving to my home directory.

EDIT: Ok I moved it to ~/.Xmodmap and when I logged in I got a dialog box, so now it does that fine, but problem #2 is still there, I have to clear the keys for expo and scale and then set them back to what they already were for it to work. Why?

EDIT: Ok it magically started working now after I rebooted tongue Just put your xmodmap at ~/.Xmodmap, how it's meant to be and everything will work smile.

Last edited by mk12 (2010-07-16 00:19:16)

Offline

Board footer

Powered by FluxBB