On Sun 16 Aug 2015 at 09:28:24 +0200, to...@tuxteam.de wrote: > Now different desktop environments have different ways to achieve that. I run > a pretty classical setup (no desktop environment at all, Fvwm as window > manager). > > In my case, the scripts in /etc/X11/Xsession.d are arranged to load those > user bits which are to be done once at the start of the X session. Especially > for xmodmap, there's this snippet in /etc/X11/Xsession.d/80x11xmodmap:
This file is a non-Debian file. It is not needed for the simple task at hand. I doubt it would ever be needed. > ============= > # 2015-01-10 tomas: why did they steal my xmodmap? > # Snarfed from <http://forums.debian.net/viewtopic.php?t=77008> > > # This file is sourced by Xsession(5), not executed. > > SYSMODMAP="/etc/X11/Xmodmap" > USRMODMAP="$HOME/.Xmodmap" > > if [ -x /usr/bin/X11/xmodmap ]; then > if [ -f "$SYSMODMAP" ]; then > xmodmap "$SYSMODMAP" > fi > > if [ -f "$USRMODMAP" ]; then > xmodmap "$USRMODMAP" > fi > fi > ============= > > (seems I stubled upon that some moons ago and was somewhat upset. I forgot > since ;-) > > Note that the syntax of the files "loaded" by xmodmap is slightly different to > what you'd have to write when issuing individual xmodmap commands. > > This is just one way to achieve that. You might as well hard-wire the commands > into your /etc/X11/Xsession There is rarely any need to alter any of the scripts in Xsession.d or add to the number there. Everything a user wants to do can be done in $HOME. Debian's X configuration is very flexible. bri...@aracnet.com has give a good account of how to use a ~/.xsession. Unfortunately, it is probably not suitable to put xmodmap commands (or any other commands) in it without starting a window manager also. The solution is to put the commands Thomas Schmit has provided in a created ~/.xsessionrc. A two-minute (not two-year) job. :) > Again, your desktop environment might provide other mechanisms for doing > things > "at start of the X session" -- or perhaps other mechanisms to change the key > mappings. All DMs read the files in /etc/X11/Xsession and, by extension. the user provided ones. But a user might feel more comfortable using the DE facilities.