I have tried seemingly everything but nothing seems to survive a reboot.

I have made a .Xmodmap in my homedir that remaps the windows key as F14 so I can use it to launch synapse.I am able to apply it when already logged in using the command:xmodmap /home/shimi/.Xmodmap

but any method I have found online to make it permanent doesn't work.The first time I log in after making that file I'm asked by MATE if I want to load it and if to ask every time. I load it and tell it not to ask again. It doesn't work the next time.

I tried making a bash script that runs said command, make it executable and add it to startup applications, but that didn't help either.

tried adding the line to .xinitrc, to /etc/X11/Xsession, to /etc/mdm/Xsession.. absolutely nothing seems to work.

However after I'm logged in and everything loads, opening a terminal and running the command successfully remaps the key.I'm completely baffled.

But to make it stick after a reboot is proving very difficult. Adding that line to the .xinitrc file in my home directory and making that file executable ought to do the trick, as this file ought to be run as a script at start up. But it doesn't work.

If I run that script at the console, bingo - I get my Pound sign. But it won't auto-run! I understood that Linux Mint should run the script automatically at boot time - I thought that was its purpose - but apparently not.

The other thing I have tried is adding the following line to the file /etc/X11/xinit/xinitrc:

Ok, found my own answer, though a bit disappointing that no-one has been able to help out with the solution to this simple question. My particular key remap is to replace the Dollar key with a Pound sign, but any other key remap will of course work, and any other script can be run in a similar fashion.

Here's how (Linux Mint Cinnamon):

1. Create a folder called "Startup" in home folder ~/ (i.e. in the folder /home/<myname>/)

2. In that folder create a text file called "PoundNotDollar.sh" containing the following lines:

This is by far the most simple and effective (without jumping through a million hoops) method of remapping the keys. Unfortunately I can't for the life of me get anything to run at startup, I'm on the latest mint 14 with xfce 4.10. So here the application startup is in menu/settings/sessions and startup and there is an applications startup tab, which, whatever you add to it doesn't start at startup. So, am stumped. Any other ideas?

I'm afraid I can't help you with Xfce on Mint 14 - What I've said only reliably applies to Mint 14 Cinnamon.

Anyhow, I'm not entirely out of the woods yet myself. I have two startup scripts; one to mount a remote CIFS share, the other to re-assign the dollar key to a pound sign. When I restart, both of these scripts run satisfactorily. When I log off and back on again, they are still running. But if I let the machine or put the machine into sleep mode, when it restarts, the CIFS mount is still mounted, but the keyboard has reverted to producing a $ sign instead of Pound sign! Can anyone shed any light on why this might be?

I'm also using the Mint 14 with xfce 4.10, and I used setxkbmap as a workaround. There's a full list of setxkbmap option codes in /usr/share/X11/xkb/rules/xorg.lst but for remapping control to caps lock all you need to do is go to Settings-->Session and Startup

Under the applications and autostart tab add an application with the following command

Thanks, I'll give that a try. I was forgetting that in the command box you could also (and need) to put terminal commands in also. I've just been linking to the address so that has probably been the problem all along.

pmorton wrote:Anyhow, I'm not entirely out of the woods yet myself. I have two startup scripts; one to mount a remote CIFS share, the other to re-assign the dollar key to a pound sign. When I restart, both of these scripts run satisfactorily. When I log off and back on again, they are still running. But if I let (or put) the machine into sleep mode, when it restarts, the CIFS mount is still mounted, but the keyboard has reverted to producing a $ sign instead of Pound sign! Can anyone shed any light on why this might be?

Well, I think I may have cracked that one too by putting the script PoundNotDollar.sh into the folder /etc/apm/scripts.d, then creating a symbolic link to it in /etc/apm/resume.d:

Maybe it will help whomever is still having trouble to read through the "/etc/mdm/Xsession" script. It is pretty well commented and may explain why your script isn't running. Reading through the Xsession script, it looks like .xsession .xsessionrc and .Xsession are all defined, but never used. I don't know why that is, but you could add a "eval exec $USERXSESSION" somewhere in the Xsession script to get .xsession called from your home folder.

I discovered that using .xsessionrc does work! At least it did for me running xmonad. I found this in the /etc/X11/Xsession.d/40x11-common_xsessionrc file. That file should probably also run .xsession and/or .xinitrc too. I guess this was a decision by the mint team to stick with only one x init file in the home directory.

I've found a solution, although it's the kludgiest kludge I've ever kludged:

Make a script called, say, ~/.keymapping.sh and make it executable. Put in it:

#!/bin/shsleep 2xmodmap ~/.Xmodmap

And make it run on startup. The two second delay makes it happen after whatever it is that's overriding the normal .Xmodmap settings happens, writing them back to the way you want. You don't get your custom keymaps for the first two seconds of each session, but it works otherwise.

I've been having similar problems with my new installation of LM 17 Mate. The system only accepts my xmodmap settings if I input them in the terminal, or if I use the sleep command as above.

I notice that the system also seems to revert my xmodmap settings if I tap the "windows" key. Either that, or when I do something else that I haven't been able to pin down. This can get really hairy, as I sometimes don't notice that I've accidentally reverted my xmodmap settings, and then caps lock, and then notice that caps lock is on, so I run the xmodmap script... only to find that I've turned off caps lock while I already had caps lock on, meaning that everything is caps locked and the only way to turn it off is to log out and back in.

Interestingly, the first time I hit the windows key, the LM start window appears, but then on second and subsequent uses, my correct xmodmap setting (â) kicks in.

It looks like something is telling the system to ignore or try to revert xmodmap settings, and I'm not sure what.

It would be nice if the keyboard settings in LM17 would allow for open-ended setting of key bindings. As it is, the drop-down radio buttons and the variety of choices are nice, but nowhere near all the possibilities I want. Also, my guess is that that program is the culprit in these xmodmap problems. I don't remember having seen those settings in previous versions of LM, and I didn't have these xmodmap reversion problems in previous versions.

I just had this situation again, where I hit caps lock expecting the | character, as I've set my xmodmap, only to get the caps lock effect instead. I hit caps lock again, then used my xmodmap script to change the caps lock key effect... only to discover that the caps lock was still on! Meaning that X was in caps lock mode, and there was no way for me to turn it off. I had to log off in the middle of a session with some sensitive stuff going on. Grrr! This is getting really frustrating.

I looked through my startup applications and noticed that I had the "ctrl+alt+backspace" option turned on. This works via setxkbmap, which I'd never heard of before, but which seems like a likely thing to mess with xmodmap. Is it?

Something is actively and continually disrupting my xmodmap settings. I don't know what it is, but I would really like it to stop!

iBus, which I use to do Chinese and other input, uses a single key combination to cycle through all input engines. Although this is a poor choice, they seem unlikely to change it. Someone discovered that they could use the Keyboard Shortcuts app to set specific input engines as shortcuts. I tried this, and it worked great!

...until I discovered that the keyboard shortcuts work via xkb. Argh! Xkb plays terribly with xmodmap, and so every time I activate a keyboard shortcut for a particular engine, I am blasting my carefully cultivated xmodmap settings to smithereens. It's like there are two armies battling for control of my keyboard, neither of whom has my best interests at heart.

This is really, really frustrating. Can someone post a solution, please? Please? I need my keyboard to work!