Creating a ~/.Xmodmap file

In order to map key combinations to specific special characters you have to create a .Xmodmap file within your users home directory. First we have to find out what the keycodes of the keys you want to map are. For this enter “xev” and press the appropriate key. You will get an output like this:

KeyPress event, serial 27, synthetic NO, window 0x1400001,
    root 0xaf, subw 0x0, time 6113848, (451,491), root:(451,511),
    state 0x0, keycode 135 (keysym 0xff7e, Mode_switch), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

On line 3 you can see “keycode 135”, which corresponds to the left windows key on my thinkpad x201s keyboard. Now write the following into your ~/.Xmodmap file:

! Map umlauts to PRINT SCREEN + <key>
keycode 135 = Mode_switch
keysym e = e E EuroSign
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp

To load your new configuration issue: xmodmap ~/.Xmodmap

ISO-Latin1 table

Symbol number   Symbol  keysym        compose   PostScript    HTML-Code

160 0xa0                nobreakspace  spc spc                 &nbsp;    
161 0xa1        ¡       exclamdown      ! !
162 0xa2        ¢       cent            C /
163 0xa3        £       sterling        L -
164 0xa4        ¤       currency        o x     /currency
165 0xa5        ¥       yen             Y -
166 0xa6        ¦       brokenbar       | |     /brokenbar
167 0xa7        §       section         S O     /section
168 0xa8        ¨       diaeresis       " "     /dieresis
169 0xa9        ©       copyright       C O     /copyright     &copy;   ©
170 0xaa        ª       ordfeminine     - A     /ordfeminine
171 0xab        «       guillemotleft   < <     /guillemotleft
172 0xac        ¬       notsign         - |     /logicalnot
173 0xad        ­        hyphen          - -     /hyphen
174 0xae        ®       registered      R O     /registered    &reg;    ®
175 0xaf        ¯       macron          ^ -     /macron
176 0xb0        °       degree          ^ *     /degree        &deg;    °
177 0xb1        ±       plusminus       + -     /plusminus
178 0xb2        ²       twosuperior     ^ 2     /twosuperior
179 0xb3        ³       threesuperior   ^ 3     /threesuperior
180 0xb4        ´       acute                 /acute
181 0xb5        µ       mu              / u     /mu
182 0xb6        ¶       paragraph       P !     /paragraph
183 0xb7        ·       periodcentered  ^ .     /periodcentered
184 0xb8        ¸       cedilla         , ,     /cedilla
185 0xb9        ¹       onesuperior     ^ 1     /onesuperior
186 0xba        º       masculine       _ O     /ordmasculine
187 0xbb        »       guillemotright  > >     /guillemotright
188 0xbc        ¼     onequarter      1 4     /onequarter
189 0xbd        ½     onehalf         1 2     /onehalf
190 0xbe        ¾     threequarters   3 4     /threequarters
191 0xbf        ¿       questiondown    ? ?     /questiondown
192 0xc0        À       Agrave          A `     /Agrave        &Agrave; À
193 0xc1        Á       Aacute          A '     /Aacute        &Aacute; Á
194 0xc2        Â       Acircumflex     A ^     /Acircumflex   &Acirc;  Â
195 0xc3        Ã       Atilde          A ~     /Atilde        &Atilde; Ã
196 0xc4        Ä       Adiaeresis      A "     /Adieresis     &Auml;   Ä
197 0xc5        Å       Aring           A *     /Aring         &Aring;  Å
198 0xc6        Æ       AE              A E     /AE            &AElig;  Æ
199 0xc7        Ç       Ccedilla        C ,     /Ccedilla      &Ccedil; Ç
200 0xc8        È       Egrave          E `     /Egrave        &Egrave; È
201 0xc9        É       Eacute          E '     /Eacute        &Eacute; É
202 0xca        Ê       Ecircumflex     E ^     /Ecircumflex   &Ecirc;  Ê
203 0xcb        Ë       Ediaeresis      E "     /Edieresis     &Euml;   Ë
204 0xcc        Ì       Igrave          I `     /Igrave        &Igrave; Ì
205 0xcd        Í       Iacute          I '     /Iacute        &Iacute; Í
206 0xce        Î       Icircumflex     I ^     /Icircumflex   &Icirc;  Î
207 0xcf        Ï       Idiaeresis      I "     /Idieresis     &Iuml;   Ï
208 0xd0        Ð       ETH             D -     /Eth
209 0xd1        Ñ       Ntilde          N ~     /Ntilde        &Ntilde; Ñ
210 0xd2        Ò       Ograve          O `     /Ograve        &Ograve; Ò
211 0xd3        Ó       Oacute          O '     /Oacute        &Oacute; Ó
212 0xd4        Ô       Ocircumflex     O ^     /Ocircumflex   &Ocirc;  Ô
213 0xd5        Õ       Otilde          O ~     /Otilde        &Otilde; Õ
214 0xd6        Ö       Odiaeresis      O "     /Odieresis     &Ouml;   Ö
215 0xd7        ×       multiply        x x     /multiply
216 0xd8        Ø       Ooblique        O /     /Oslash        &Oslash; Ø
217 0xd9        Ù       Ugrave          U `     /Ugrave        &Ugrave; Ù
218 0xda        Ú       Uacute          U '     /Uacute        &Uacute; Ú
219 0xdb        Û       Ucircumflex     U ^     /Ucircumflex   &Ucirc;  Û
220 0xdc        Ü       Udiaeresis      U "     /Udieresis     &Uuml;   Ü
221 0xdd        Ý       Yacute          Y '     /Yacute        &Yacute; Ý
222 0xde        Þ       THORN           P |     /Thorn
223 0xdf        ß       ssharp          s s     /germandbls    &szlig;  ß
224 0xe0        à       agrave          a `     /agrave        &agrave; à
225 0xe1        á       aacute          a '     /aacute        &aacute; á
226 0xe2        â       acircumflex     a ^     /acircumflex   &acirc;  â
227 0xe3        ã       atilde          a ~     /atilde        &atilde; ã
228 0xe4        ä       adiaeresis      a "     /adieresis     &auml;   ä
229 0xe5        å       aring           a *     /aring         &aring;  å
230 0xe6        æ       ae              a e     /ae            &aelig;  æ
231 0xe7        ç       ccedilla        c ,     /ccedilla      &ccedil; ç
232 0xe8        è       egrave          e `     /egrave        &egrave; è
233 0xe9        é       eacute          e '     /eacute        &eacute; é
234 0xea        ê       ecircumflex     e ^     /ecircumflex   &ecirc;  ê
235 0xeb        ë       ediaeresis      e "     /edieresis     &euml;   ë
236 0xec        ì       igrave          i `     /igrave        &igrave; ì
237 0xed        í       iacute          i '     /iacute        &iacute; í
238 0xee        î       icircumflex     i ^     /icircumflex   &icirc;  î
239 0xef        ï       idiaeresis      i "     /idieresis     &iuml;   ï
240 0xf0        ð       eth             d -     /eth
241 0xf1        ñ       ntilde          n ~     /ntilde        &ntilde; ñ
242 0xf2        ò       ograve          o `     /ograve        &ograve; ò
243 0xf3        ó       oacute          o '     /oacute        &oacute; ó
244 0xf4        ô       ocircumflex     o ^     /ocircumflex   &ocirc;  ô
245 0xf5        õ       otilde          o ~     /otilde        &otilde; õ
246 0xf6        ö       odiaeresis      o "     /odieresis     &ouml;   ö
247 0xf7        ÷       division        - :     /divide
248 0xf8        ø       oslash          o /     /oslash        &oslash; ø
249 0xf9        ù       ugrave          u `     /ugrave        &ugrave; ù
250 0xfa        ú       uacute          u '     /uacute        &uacute; ú
251 0xfb        û       ucircumflex     u ^     /ucircumflex   &ucirc;  û
252 0xfc        ü       udiaeresis      u "     /udieresis     &uuml;   ü
253 0xfd        ý       yacute          y '     /yacute        &yacute; ý
254 0xfe        þ       thorn           p |     /thorn
255 0xff        ÿ       ydiaeresis      y "     /ydieresis     &yuml;   ÿ