edgecase
Author: StJohn Piano
Published: 2019-04-14
Datafeed Article 99
This article has been digitally signed by Edgecase Datafeed.
This article has been digitally signed by its author.
13350 words - 4205 lines - 106 pages





GOAL



Learn how to remap keys in CentOS 7.6. Primary goal: Swap Caps Lock and Ctrl keys. Secondary goal: Set F5 to be Escape.




CONTENTS



- Goal
- Contents
- Brief Summary
- Project Log




BRIEF SUMMARY



After experimentation and testing, I made these final changes:
1) Set Alt_L key to perform the Control_L function. Adjust modifier map for "control" and for "alt".
2) Set Control_L key to perform the Alt_L function. Adjust modifier map for "control" and for "alt".
3) Set F5 key to perform the Escape function.
4) Set Shift + Backspace key to perform the Delete function (i.e. delete next character).
5) Automate these steps in a script. Set this script to be executed on login via the Gnome GUI.




PROJECT LOG




Some reading indicates that:
- Linux uses two keyboard mappings, one for the console and one for the graphical mode (the X Window System).
- The console keyboard mapping can be altered using
loadkeys
.
- The existing keymaps for
loadkeys
are stored in
/usr/share/kbd/keymaps
. A description of these files is available in
man 5 keymaps
.
- The graphical mode keyboard mapping can be altered using
setxkbmap
or
xmodmap
.
Source:
unix.stackexchange.com/questions/177024/remap-keyboard-on-the-linux-console
Author: michas
Date: Jan 2 '15



System details:
- Name: Shovel
- Specifications: HP 6005 Pro SFF. 3 GHz x86_64 processor (AMD II x4 B95 Quad Core), 4 GB RAM, 1 TB hard drive. Running CentOS 7.6.1810 (Core).
- More information: New computer: Shovel
- Installed items: GCC 4.8.5, Make 3.82.



Create new project directory:
remapping_keys_in_centos_76

Within new project directory, create new work directory:
work

Open a terminal and change directory to the work directory.



[spiano@localhost work]$ xmodmap --version

xmodmap: unrecognized argument --version usage: xmodmap [-options ...] [filename] where options include: -display host:dpy X server to use -verbose, -quiet turn logging on or off -n don't execute changes, just show like make -e expression execute string -pm print modifier map -pk print keymap table -pke print keymap table as expressions -pp print pointer map -help print this usage message -grammar print out short help on allowable input -version print program version - read standard input



[spiano@localhost work]$ xmodmap -version

xmodmap 1.0.9


[spiano@localhost work]$ xmodmap -grammar

xmodmap accepts the following input expressions: pointer = default reset pointer buttons to default pointer = NUMBER ... set pointer button codes keycode NUMBER = [KEYSYM ...] map keycode to given keysyms keysym KEYSYM = [KEYSYM ...] look up keysym and do a keycode operation clear MODIFIER remove all keys for this modifier add MODIFIER = KEYSYM ... add the keysyms to the modifier remove MODIFIER = KEYSYM ... remove the keysyms from the modifier where NUMBER is a decimal, octal, or hex constant; KEYSYM is a valid Key Symbol name; and MODIFIER is one of the eight modifier names: Shift, Lock, Control, Mod1, Mod2, Mod3, Mod4, or Mod5. Lines beginning with an exclamation mark (!) are taken as comments. Case is significant except for MODIFIER names. Keysyms on the left hand side of the = sign are looked up before any changes are made; keysyms on the right are looked up after all of those on the left have been resolved. This makes it possible to swap modifier keys.



[spiano@localhost work]$ xmodmap -pk

There are 10 KeySyms per KeyCode; KeyCodes range from 8 to 255. KeyCode Keysym (Keysym) ... Value Value (Name) ... 8 9 0xff1b (Escape) 0x0000 (NoSymbol) 0xff1b (Escape) 10 0x0031 (1) 0x0021 (exclam) 0x0031 (1) 0x0021 (exclam) 0x00b9 (onesuperior) 0x00a1 (exclamdown) 11 0x0032 (2) 0x0040 (at) 0x0032 (2) 0x0022 (quotedbl) 0x00b2 (twosuperior) 0x0ac3 (oneeighth) 12 0x0033 (3) 0x0023 (numbersign) 0x0033 (3) 0x00a3 (sterling) 0x00b3 (threesuperior) 0x00a3 (sterling) 13 0x0034 (4) 0x0024 (dollar) 0x0034 (4) 0x0024 (dollar) 0x20ac (EuroSign) 0x00bc (onequarter) 14 0x0035 (5) 0x0025 (percent) 0x0035 (5) 0x0025 (percent) 0x00bd (onehalf) 0x0ac4 (threeeighths) 15 0x0036 (6) 0x005e (asciicircum) 0x0036 (6) 0x005e (asciicircum) 0x00be (threequarters) 0x0ac5 (fiveeighths) 16 0x0037 (7) 0x0026 (ampersand) 0x0037 (7) 0x0026 (ampersand) 0x007b (braceleft) 0x0ac6 (seveneighths) 17 0x0038 (8) 0x002a (asterisk) 0x0038 (8) 0x002a (asterisk) 0x005b (bracketleft) 0x0ac9 (trademark) 18 0x0039 (9) 0x0028 (parenleft) 0x0039 (9) 0x0028 (parenleft) 0x005d (bracketright) 0x00b1 (plusminus) 19 0x0030 (0) 0x0029 (parenright) 0x0030 (0) 0x0029 (parenright) 0x007d (braceright) 0x00b0 (degree) 20 0x002d (minus) 0x005f (underscore) 0x002d (minus) 0x005f (underscore) 0x005c (backslash) 0x00bf (questiondown) 21 0x003d (equal) 0x002b (plus) 0x003d (equal) 0x002b (plus) 0xfe5b (dead_cedilla) 0xfe5c (dead_ogonek) 22 0xff08 (BackSpace) 0xff08 (BackSpace) 0xff08 (BackSpace) 0xff08 (BackSpace) 23 0xff09 (Tab) 0xfe20 (ISO_Left_Tab) 0xff09 (Tab) 0xfe20 (ISO_Left_Tab) 24 0x0071 (q) 0x0051 (Q) 0x0071 (q) 0x0051 (Q) 0x0040 (at) 0x07d9 (Greek_OMEGA) 25 0x0077 (w) 0x0057 (W) 0x0077 (w) 0x0057 (W) 0x01b3 (lstroke) 0x01a3 (Lstroke) 26 0x0065 (e) 0x0045 (E) 0x0065 (e) 0x0045 (E) 0x0065 (e) 0x0045 (E) 27 0x0072 (r) 0x0052 (R) 0x0072 (r) 0x0052 (R) 0x00b6 (paragraph) 0x00ae (registered) 28 0x0074 (t) 0x0054 (T) 0x0074 (t) 0x0054 (T) 0x03bc (tslash) 0x03ac (Tslash) 29 0x0079 (y) 0x0059 (Y) 0x0079 (y) 0x0059 (Y) 0x08fb (leftarrow) 0x00a5 (yen) 30 0x0075 (u) 0x0055 (U) 0x0075 (u) 0x0055 (U) 0x08fe (downarrow) 0x08fc (uparrow) 31 0x0069 (i) 0x0049 (I) 0x0069 (i) 0x0049 (I) 0x08fd (rightarrow) 0x02b9 (idotless) 32 0x006f (o) 0x004f (O) 0x006f (o) 0x004f (O) 0x00f8 (oslash) 0x00d8 (Oslash) 33 0x0070 (p) 0x0050 (P) 0x0070 (p) 0x0050 (P) 0x00fe (thorn) 0x00de (THORN) 34 0x005b (bracketleft) 0x007b (braceleft) 0x005b (bracketleft) 0x007b (braceleft) 0xfe57 (dead_diaeresis) 0xfe58 (dead_abovering) 35 0x005d (bracketright) 0x007d (braceright) 0x005d (bracketright) 0x007d (braceright) 0xfe53 (dead_tilde) 0xfe54 (dead_macron) 36 0xff0d (Return) 0x0000 (NoSymbol) 0xff0d (Return) 37 0xffe3 (Control_L) 0x0000 (NoSymbol) 0xffe3 (Control_L) 38 0x0061 (a) 0x0041 (A) 0x0061 (a) 0x0041 (A) 0x00e6 (ae) 0x00c6 (AE) 39 0x0073 (s) 0x0053 (S) 0x0073 (s) 0x0053 (S) 0x00df (ssharp) 0x00a7 (section) 40 0x0064 (d) 0x0044 (D) 0x0064 (d) 0x0044 (D) 0x00f0 (eth) 0x00d0 (ETH) 41 0x0066 (f) 0x0046 (F) 0x0066 (f) 0x0046 (F) 0x01f0 (dstroke) 0x00aa (ordfeminine) 42 0x0067 (g) 0x0047 (G) 0x0067 (g) 0x0047 (G) 0x03bf (eng) 0x03bd (ENG) 43 0x0068 (h) 0x0048 (H) 0x0068 (h) 0x0048 (H) 0x02b1 (hstroke) 0x02a1 (Hstroke) 44 0x006a (j) 0x004a (J) 0x006a (j) 0x004a (J) 0xfe61 (dead_hook) 0xfe62 (dead_horn) 45 0x006b (k) 0x004b (K) 0x006b (k) 0x004b (K) 0x03a2 (kra) 0x0026 (ampersand) 46 0x006c (l) 0x004c (L) 0x006c (l) 0x004c (L) 0x01b3 (lstroke) 0x01a3 (Lstroke) 47 0x003b (semicolon) 0x003a (colon) 0x003b (semicolon) 0x003a (colon) 0xfe51 (dead_acute) 0xfe59 (dead_doubleacute) 48 0x0027 (apostrophe) 0x0022 (quotedbl) 0x0027 (apostrophe) 0x0040 (at) 0xfe52 (dead_circumflex) 0xfe5a (dead_caron) 49 0x0060 (grave) 0x007e (asciitilde) 0x0060 (grave) 0x00ac (notsign) 0x007c (bar) 0x007c (bar) 50 0xffe1 (Shift_L) 0x0000 (NoSymbol) 0xffe1 (Shift_L) 51 0x005c (backslash) 0x007c (bar) 0x0023 (numbersign) 0x007e (asciitilde) 0xfe50 (dead_grave)0xfe55 (dead_breve) 52 0x007a (z) 0x005a (Z) 0x007a (z) 0x005a (Z) 0x00ab (guillemotleft) 0x003c (less) 53 0x0078 (x) 0x0058 (X) 0x0078 (x) 0x0058 (X) 0x00bb (guillemotright) 0x003e (greater) 54 0x0063 (c) 0x0043 (C) 0x0063 (c) 0x0043 (C) 0x00a2 (cent) 0x00a9 (copyright) 55 0x0076 (v) 0x0056 (V) 0x0076 (v) 0x0056 (V) 0x0ad2 (leftdoublequotemark) 0x0ad0 (leftsinglequotemark) 56 0x0062 (b) 0x0042 (B) 0x0062 (b) 0x0042 (B) 0x0ad3 (rightdoublequotemark) 0x0ad1 (rightsinglequotemark) 57 0x006e (n) 0x004e (N) 0x006e (n) 0x004e (N) 0x006e (n) 0x004e (N) 58 0x006d (m) 0x004d (M) 0x006d (m) 0x004d (M) 0x00b5 (mu) 0x00ba (masculine) 59 0x002c (comma) 0x003c (less) 0x002c (comma) 0x003c (less) 0x08a3 (horizconnector) 0x00d7 (multiply) 60 0x002e (period) 0x003e (greater) 0x002e (period) 0x003e (greater) 0x00b7 (periodcentered) 0x00f7 (division) 61 0x002f (slash) 0x003f (question) 0x002f (slash) 0x003f (question) 0xfe60 (dead_belowdot) 0xfe56 (dead_abovedot) 62 0xffe2 (Shift_R) 0x0000 (NoSymbol) 0xffe2 (Shift_R) 63 0xffaa (KP_Multiply) 0xffaa (KP_Multiply) 0xffaa (KP_Multiply) 0xffaa (KP_Multiply) 0xffaa (KP_Multiply) 0xffaa (KP_Multiply) 0x1008fe21 (XF86ClearGrab) 0xffaa (KP_Multiply) 0xffaa (KP_Multiply) 0x1008fe21 (XF86ClearGrab) 64 0xffe9 (Alt_L) 0xffe7 (Meta_L) 0xffe9 (Alt_L) 0xffe7 (Meta_L) 65 0x0020 (space) 0x0000 (NoSymbol) 0x0020 (space) 66 0xffe5 (Caps_Lock) 0x0000 (NoSymbol) 0xffe5 (Caps_Lock) 67 0xffbe (F1) 0xffbe (F1) 0xffbe (F1) 0xffbe (F1) 0xffbe (F1) 0xffbe (F1) 0x1008fe01 (XF86Switch_VT_1) 0xffbe (F1) 0xffbe (F1) 0x1008fe01 (XF86Switch_VT_1) 68 0xffbf (F2) 0xffbf (F2) 0xffbf (F2) 0xffbf (F2) 0xffbf (F2) 0xffbf (F2) 0x1008fe02 (XF86Switch_VT_2) 0xffbf (F2) 0xffbf (F2) 0x1008fe02 (XF86Switch_VT_2) 69 0xffc0 (F3) 0xffc0 (F3) 0xffc0 (F3) 0xffc0 (F3) 0xffc0 (F3) 0xffc0 (F3) 0x1008fe03 (XF86Switch_VT_3) 0xffc0 (F3) 0xffc0 (F3) 0x1008fe03 (XF86Switch_VT_3) 70 0xffc1 (F4) 0xffc1 (F4) 0xffc1 (F4) 0xffc1 (F4) 0xffc1 (F4) 0xffc1 (F4) 0x1008fe04 (XF86Switch_VT_4) 0xffc1 (F4) 0xffc1 (F4) 0x1008fe04 (XF86Switch_VT_4) 71 0xffc2 (F5) 0xffc2 (F5) 0xffc2 (F5) 0xffc2 (F5) 0xffc2 (F5) 0xffc2 (F5) 0x1008fe05 (XF86Switch_VT_5) 0xffc2 (F5) 0xffc2 (F5) 0x1008fe05 (XF86Switch_VT_5) 72 0xffc3 (F6) 0xffc3 (F6) 0xffc3 (F6) 0xffc3 (F6) 0xffc3 (F6) 0xffc3 (F6) 0x1008fe06 (XF86Switch_VT_6) 0xffc3 (F6) 0xffc3 (F6) 0x1008fe06 (XF86Switch_VT_6) 73 0xffc4 (F7) 0xffc4 (F7) 0xffc4 (F7) 0xffc4 (F7) 0xffc4 (F7) 0xffc4 (F7) 0x1008fe07 (XF86Switch_VT_7) 0xffc4 (F7) 0xffc4 (F7) 0x1008fe07 (XF86Switch_VT_7) 74 0xffc5 (F8) 0xffc5 (F8) 0xffc5 (F8) 0xffc5 (F8) 0xffc5 (F8) 0xffc5 (F8) 0x1008fe08 (XF86Switch_VT_8) 0xffc5 (F8) 0xffc5 (F8) 0x1008fe08 (XF86Switch_VT_8) 75 0xffc6 (F9) 0xffc6 (F9) 0xffc6 (F9) 0xffc6 (F9) 0xffc6 (F9) 0xffc6 (F9) 0x1008fe09 (XF86Switch_VT_9) 0xffc6 (F9) 0xffc6 (F9) 0x1008fe09 (XF86Switch_VT_9) 76 0xffc7 (F10) 0xffc7 (F10) 0xffc7 (F10) 0xffc7 (F10) 0xffc7 (F10) 0xffc7 (F10) 0x1008fe0a (XF86Switch_VT_10) 0xffc7 (F10) 0xffc7 (F10) 0x1008fe0a (XF86Switch_VT_10) 77 0xff7f (Num_Lock) 0x0000 (NoSymbol) 0xff7f (Num_Lock) 78 0xff14 (Scroll_Lock) 0x0000 (NoSymbol) 0xff14 (Scroll_Lock) 79 0xff95 (KP_Home) 0xffb7 (KP_7) 0xff95 (KP_Home) 0xffb7 (KP_7) 80 0xff97 (KP_Up) 0xffb8 (KP_8) 0xff97 (KP_Up) 0xffb8 (KP_8) 81 0xff9a (KP_Prior) 0xffb9 (KP_9) 0xff9a (KP_Prior) 0xffb9 (KP_9) 82 0xffad (KP_Subtract) 0xffad (KP_Subtract) 0xffad (KP_Subtract) 0xffad (KP_Subtract) 0xffad (KP_Subtract) 0xffad (KP_Subtract) 0x1008fe23 (XF86Prev_VMode) 0xffad (KP_Subtract) 0xffad (KP_Subtract) 0x1008fe23 (XF86Prev_VMode) 83 0xff96 (KP_Left) 0xffb4 (KP_4) 0xff96 (KP_Left) 0xffb4 (KP_4) 84 0xff9d (KP_Begin) 0xffb5 (KP_5) 0xff9d (KP_Begin) 0xffb5 (KP_5) 85 0xff98 (KP_Right) 0xffb6 (KP_6) 0xff98 (KP_Right) 0xffb6 (KP_6) 86 0xffab (KP_Add) 0xffab (KP_Add) 0xffab (KP_Add) 0xffab (KP_Add) 0xffab (KP_Add) 0xffab (KP_Add) 0x1008fe22 (XF86Next_VMode) 0xffab (KP_Add) 0xffab (KP_Add) 0x1008fe22 (XF86Next_VMode) 87 0xff9c (KP_End) 0xffb1 (KP_1) 0xff9c (KP_End) 0xffb1 (KP_1) 88 0xff99 (KP_Down) 0xffb2 (KP_2) 0xff99 (KP_Down) 0xffb2 (KP_2) 89 0xff9b (KP_Next) 0xffb3 (KP_3) 0xff9b (KP_Next) 0xffb3 (KP_3) 90 0xff9e (KP_Insert) 0xffb0 (KP_0) 0xff9e (KP_Insert) 0xffb0 (KP_0) 91 0xff9f (KP_Delete) 0xffae (KP_Decimal) 0xff9f (KP_Delete) 0xffae (KP_Decimal) 92 0xfe03 (ISO_Level3_Shift) 0x0000 (NoSymbol) 0xfe03 (ISO_Level3_Shift) 93 94 0x003c (less) 0x003e (greater) 0x005c (backslash) 0x007c (bar) 0x007c (bar) 0x00a6 (brokenbar) 0x007c (bar) 0x00a6 (brokenbar) 95 0xffc8 (F11) 0xffc8 (F11) 0xffc8 (F11) 0xffc8 (F11) 0xffc8 (F11) 0xffc8 (F11) 0x1008fe0b (XF86Switch_VT_11) 0xffc8 (F11) 0xffc8 (F11) 0x1008fe0b (XF86Switch_VT_11) 96 0xffc9 (F12) 0xffc9 (F12) 0xffc9 (F12) 0xffc9 (F12) 0xffc9 (F12) 0xffc9 (F12) 0x1008fe0c (XF86Switch_VT_12) 0xffc9 (F12) 0xffc9 (F12) 0x1008fe0c (XF86Switch_VT_12) 97 98 0xff26 (Katakana) 0x0000 (NoSymbol) 0xff26 (Katakana) 99 0xff25 (Hiragana) 0x0000 (NoSymbol) 0xff25 (Hiragana) 100 0xff23 (Henkan_Mode) 0x0000 (NoSymbol) 0xff23 (Henkan_Mode) 101 0xff27 (Hiragana_Katakana) 0x0000 (NoSymbol) 0xff27 (Hiragana_Katakana) 102 0xff22 (Muhenkan) 0x0000 (NoSymbol) 0xff22 (Muhenkan) 103 104 0xff8d (KP_Enter) 0x0000 (NoSymbol) 0xff8d (KP_Enter) 105 0xffe4 (Control_R) 0x0000 (NoSymbol) 0xffe4 (Control_R) 106 0xffaf (KP_Divide) 0xffaf (KP_Divide) 0xffaf (KP_Divide) 0xffaf (KP_Divide) 0xffaf (KP_Divide) 0xffaf (KP_Divide) 0x1008fe20 (XF86Ungrab) 0xffaf (KP_Divide) 0xffaf (KP_Divide) 0x1008fe20 (XF86Ungrab) 107 0xff61 (Print) 0xff15 (Sys_Req) 0xff61 (Print) 0xff15 (Sys_Req) 108 0xffea (Alt_R) 0xffe8 (Meta_R) 0xfe03 (ISO_Level3_Shift) 0xff20 (Multi_key) 109 0xff0a (Linefeed) 0x0000 (NoSymbol) 0xff0a (Linefeed) 110 0xff50 (Home) 0x0000 (NoSymbol) 0xff50 (Home) 111 0xff52 (Up) 0x0000 (NoSymbol) 0xff52 (Up) 112 0xff55 (Prior) 0x0000 (NoSymbol) 0xff55 (Prior) 113 0xff51 (Left) 0x0000 (NoSymbol) 0xff51 (Left) 114 0xff53 (Right) 0x0000 (NoSymbol) 0xff53 (Right) 115 0xff57 (End) 0x0000 (NoSymbol) 0xff57 (End) 116 0xff54 (Down) 0x0000 (NoSymbol) 0xff54 (Down) 117 0xff56 (Next) 0x0000 (NoSymbol) 0xff56 (Next) 118 0xff63 (Insert) 0x0000 (NoSymbol) 0xff63 (Insert) 119 0xffff (Delete) 0x0000 (NoSymbol) 0xffff (Delete) 120 121 0x1008ff12 (XF86AudioMute) 0x0000 (NoSymbol) 0x1008ff12 (XF86AudioMute) 122 0x1008ff11 (XF86AudioLowerVolume) 0x0000 (NoSymbol) 0x1008ff11 (XF86AudioLowerVolume) 123 0x1008ff13 (XF86AudioRaiseVolume) 0x0000 (NoSymbol) 0x1008ff13 (XF86AudioRaiseVolume) 124 0x1008ff2a (XF86PowerOff) 0x0000 (NoSymbol) 0x1008ff2a (XF86PowerOff) 125 0xffbd (KP_Equal) 0x0000 (NoSymbol) 0xffbd (KP_Equal) 126 0x00b1 (plusminus) 0x0000 (NoSymbol) 0x00b1 (plusminus) 127 0xff13 (Pause) 0xff6b (Break) 0xff13 (Pause) 0xff6b (Break) 128 0x1008ff4a (XF86LaunchA) 0x0000 (NoSymbol) 0x1008ff4a (XF86LaunchA) 129 0xffae (KP_Decimal) 0xffae (KP_Decimal) 0xffae (KP_Decimal) 0xffae (KP_Decimal) 130 0xff31 (Hangul) 0x0000 (NoSymbol) 0xff31 (Hangul) 131 0xff34 (Hangul_Hanja) 0x0000 (NoSymbol) 0xff34 (Hangul_Hanja) 132 133 0xffeb (Super_L) 0x0000 (NoSymbol) 0xffeb (Super_L) 134 0xffec (Super_R) 0x0000 (NoSymbol) 0xffec (Super_R) 135 0xff67 (Menu) 0x0000 (NoSymbol) 0xff67 (Menu) 136 0xff69 (Cancel) 0x0000 (NoSymbol) 0xff69 (Cancel) 137 0xff66 (Redo) 0x0000 (NoSymbol) 0xff66 (Redo) 138 0x1005ff70 (SunProps) 0x0000 (NoSymbol) 0x1005ff70 (SunProps) 139 0xff65 (Undo) 0x0000 (NoSymbol) 0xff65 (Undo) 140 0x1005ff71 (SunFront) 0x0000 (NoSymbol) 0x1005ff71 (SunFront) 141 0x1008ff57 (XF86Copy) 0x0000 (NoSymbol) 0x1008ff57 (XF86Copy) 142 0x1008ff6b (XF86Open) 0x0000 (NoSymbol) 0x1008ff6b (XF86Open) 143 0x1008ff6d (XF86Paste) 0x0000 (NoSymbol) 0x1008ff6d (XF86Paste) 144 0xff68 (Find) 0x0000 (NoSymbol) 0xff68 (Find) 145 0x1008ff58 (XF86Cut) 0x0000 (NoSymbol) 0x1008ff58 (XF86Cut) 146 0xff6a (Help) 0x0000 (NoSymbol) 0xff6a (Help) 147 0x1008ff65 (XF86MenuKB) 0x0000 (NoSymbol) 0x1008ff65 (XF86MenuKB) 148 0x1008ff1d (XF86Calculator) 0x0000 (NoSymbol) 0x1008ff1d (XF86Calculator) 149 150 0x1008ff2f (XF86Sleep) 0x0000 (NoSymbol) 0x1008ff2f (XF86Sleep) 151 0x1008ff2b (XF86WakeUp) 0x0000 (NoSymbol) 0x1008ff2b (XF86WakeUp) 152 0x1008ff5d (XF86Explorer) 0x0000 (NoSymbol) 0x1008ff5d (XF86Explorer) 153 0x1008ff7b (XF86Send) 0x0000 (NoSymbol) 0x1008ff7b (XF86Send) 154 155 0x1008ff8a (XF86Xfer) 0x0000 (NoSymbol) 0x1008ff8a (XF86Xfer) 156 0x1008ff41 (XF86Launch1) 0x0000 (NoSymbol) 0x1008ff41 (XF86Launch1) 157 0x1008ff42 (XF86Launch2) 0x0000 (NoSymbol) 0x1008ff42 (XF86Launch2) 158 0x1008ff2e (XF86WWW) 0x0000 (NoSymbol) 0x1008ff2e (XF86WWW) 159 0x1008ff5a (XF86DOS) 0x0000 (NoSymbol) 0x1008ff5a (XF86DOS) 160 0x1008ff2d (XF86ScreenSaver) 0x0000 (NoSymbol) 0x1008ff2d (XF86ScreenSaver) 161 0x1008ff74 (XF86RotateWindows) 0x0000 (NoSymbol) 0x1008ff74 (XF86RotateWindows) 162 0x1008ff7f (XF86TaskPane) 0x0000 (NoSymbol) 0x1008ff7f (XF86TaskPane) 163 0x1008ff19 (XF86Mail) 0x0000 (NoSymbol) 0x1008ff19 (XF86Mail) 164 0x1008ff30 (XF86Favorites) 0x0000 (NoSymbol) 0x1008ff30 (XF86Favorites) 165 0x1008ff33 (XF86MyComputer) 0x0000 (NoSymbol) 0x1008ff33 (XF86MyComputer) 166 0x1008ff26 (XF86Back) 0x0000 (NoSymbol) 0x1008ff26 (XF86Back) 167 0x1008ff27 (XF86Forward) 0x0000 (NoSymbol) 0x1008ff27 (XF86Forward) 168 169 0x1008ff2c (XF86Eject) 0x0000 (NoSymbol) 0x1008ff2c (XF86Eject) 170 0x1008ff2c (XF86Eject) 0x1008ff2c (XF86Eject) 0x1008ff2c (XF86Eject) 0x1008ff2c (XF86Eject) 171 0x1008ff17 (XF86AudioNext) 0x0000 (NoSymbol) 0x1008ff17 (XF86AudioNext) 172 0x1008ff14 (XF86AudioPlay) 0x1008ff31 (XF86AudioPause) 0x1008ff14 (XF86AudioPlay) 0x1008ff31 (XF86AudioPause) 173 0x1008ff16 (XF86AudioPrev) 0x0000 (NoSymbol) 0x1008ff16 (XF86AudioPrev) 174 0x1008ff15 (XF86AudioStop) 0x1008ff2c (XF86Eject) 0x1008ff15 (XF86AudioStop) 0x1008ff2c (XF86Eject) 175 0x1008ff1c (XF86AudioRecord) 0x0000 (NoSymbol) 0x1008ff1c (XF86AudioRecord) 176 0x1008ff3e (XF86AudioRewind) 0x0000 (NoSymbol) 0x1008ff3e (XF86AudioRewind) 177 0x1008ff6e (XF86Phone) 0x0000 (NoSymbol) 0x1008ff6e (XF86Phone) 178 179 0x1008ff81 (XF86Tools) 0x0000 (NoSymbol) 0x1008ff81 (XF86Tools) 180 0x1008ff18 (XF86HomePage) 0x0000 (NoSymbol) 0x1008ff18 (XF86HomePage) 181 0x1008ff73 (XF86Reload) 0x0000 (NoSymbol) 0x1008ff73 (XF86Reload) 182 0x1008ff56 (XF86Close) 0x0000 (NoSymbol) 0x1008ff56 (XF86Close) 183 184 185 0x1008ff78 (XF86ScrollUp) 0x0000 (NoSymbol) 0x1008ff78 (XF86ScrollUp) 186 0x1008ff79 (XF86ScrollDown) 0x0000 (NoSymbol) 0x1008ff79 (XF86ScrollDown) 187 0x0028 (parenleft) 0x0000 (NoSymbol) 0x0028 (parenleft) 188 0x0029 (parenright) 0x0000 (NoSymbol) 0x0029 (parenright) 189 0x1008ff68 (XF86New) 0x0000 (NoSymbol) 0x1008ff68 (XF86New) 190 0xff66 (Redo) 0x0000 (NoSymbol) 0xff66 (Redo) 191 0x1008ff81 (XF86Tools) 0x0000 (NoSymbol) 0x1008ff81 (XF86Tools) 192 0x1008ff45 (XF86Launch5) 0x0000 (NoSymbol) 0x1008ff45 (XF86Launch5) 193 0x1008ff46 (XF86Launch6) 0x0000 (NoSymbol) 0x1008ff46 (XF86Launch6) 194 0x1008ff47 (XF86Launch7) 0x0000 (NoSymbol) 0x1008ff47 (XF86Launch7) 195 0x1008ff48 (XF86Launch8) 0x0000 (NoSymbol) 0x1008ff48 (XF86Launch8) 196 0x1008ff49 (XF86Launch9) 0x0000 (NoSymbol) 0x1008ff49 (XF86Launch9) 197 198 0x1008ffb2 (XF86AudioMicMute) 0x0000 (NoSymbol) 0x1008ffb2 (XF86AudioMicMute) 199 0x1008ffa9 (XF86TouchpadToggle) 0x0000 (NoSymbol) 0x1008ffa9 (XF86TouchpadToggle) 200 0x1008ffb0 (XF86TouchpadOn) 0x0000 (NoSymbol) 0x1008ffb0 (XF86TouchpadOn) 201 0x1008ffb1 (XF86TouchpadOff) 0x0000 (NoSymbol) 0x1008ffb1 (XF86TouchpadOff) 202 203 0xff7e (Mode_switch) 0x0000 (NoSymbol) 0xff7e (Mode_switch) 204 0x0000 (NoSymbol) 0xffe9 (Alt_L) 0x0000 (NoSymbol) 0xffe9 (Alt_L) 205 0x0000 (NoSymbol) 0xffe7 (Meta_L) 0x0000 (NoSymbol) 0xffe7 (Meta_L) 206 0x0000 (NoSymbol) 0xffeb (Super_L) 0x0000 (NoSymbol) 0xffeb (Super_L) 207 0x0000 (NoSymbol) 0xffed (Hyper_L) 0x0000 (NoSymbol) 0xffed (Hyper_L) 208 0x1008ff14 (XF86AudioPlay) 0x0000 (NoSymbol) 0x1008ff14 (XF86AudioPlay) 209 0x1008ff31 (XF86AudioPause) 0x0000 (NoSymbol) 0x1008ff31 (XF86AudioPause) 210 0x1008ff43 (XF86Launch3) 0x0000 (NoSymbol) 0x1008ff43 (XF86Launch3) 211 0x1008ff44 (XF86Launch4) 0x0000 (NoSymbol) 0x1008ff44 (XF86Launch4) 212 0x1008ff4b (XF86LaunchB) 0x0000 (NoSymbol) 0x1008ff4b (XF86LaunchB) 213 0x1008ffa7 (XF86Suspend) 0x0000 (NoSymbol) 0x1008ffa7 (XF86Suspend) 214 0x1008ff56 (XF86Close) 0x0000 (NoSymbol) 0x1008ff56 (XF86Close) 215 0x1008ff14 (XF86AudioPlay) 0x0000 (NoSymbol) 0x1008ff14 (XF86AudioPlay) 216 0x1008ff97 (XF86AudioForward) 0x0000 (NoSymbol) 0x1008ff97 (XF86AudioForward) 217 218 0xff61 (Print) 0x0000 (NoSymbol) 0xff61 (Print) 219 220 0x1008ff8f (XF86WebCam) 0x0000 (NoSymbol) 0x1008ff8f (XF86WebCam) 221 222 223 0x1008ff19 (XF86Mail) 0x0000 (NoSymbol) 0x1008ff19 (XF86Mail) 224 0x1008ff8e (XF86Messenger) 0x0000 (NoSymbol) 0x1008ff8e (XF86Messenger) 225 0x1008ff1b (XF86Search) 0x0000 (NoSymbol) 0x1008ff1b (XF86Search) 226 0x1008ff5f (XF86Go) 0x0000 (NoSymbol) 0x1008ff5f (XF86Go) 227 0x1008ff3c (XF86Finance) 0x0000 (NoSymbol) 0x1008ff3c (XF86Finance) 228 0x1008ff5e (XF86Game) 0x0000 (NoSymbol) 0x1008ff5e (XF86Game) 229 0x1008ff36 (XF86Shop) 0x0000 (NoSymbol) 0x1008ff36 (XF86Shop) 230 231 0xff69 (Cancel) 0x0000 (NoSymbol) 0xff69 (Cancel) 232 0x1008ff03 (XF86MonBrightnessDown) 0x0000 (NoSymbol) 0x1008ff03 (XF86MonBrightnessDown) 233 0x1008ff02 (XF86MonBrightnessUp) 0x0000 (NoSymbol) 0x1008ff02 (XF86MonBrightnessUp) 234 0x1008ff32 (XF86AudioMedia) 0x0000 (NoSymbol) 0x1008ff32 (XF86AudioMedia) 235 0x1008ff59 (XF86Display) 0x0000 (NoSymbol) 0x1008ff59 (XF86Display) 236 0x1008ff04 (XF86KbdLightOnOff) 0x0000 (NoSymbol) 0x1008ff04 (XF86KbdLightOnOff) 237 0x1008ff06 (XF86KbdBrightnessDown) 0x0000 (NoSymbol) 0x1008ff06 (XF86KbdBrightnessDown) 238 0x1008ff05 (XF86KbdBrightnessUp) 0x0000 (NoSymbol) 0x1008ff05 (XF86KbdBrightnessUp) 239 0x1008ff7b (XF86Send) 0x0000 (NoSymbol) 0x1008ff7b (XF86Send) 240 0x1008ff72 (XF86Reply) 0x0000 (NoSymbol) 0x1008ff72 (XF86Reply) 241 0x1008ff90 (XF86MailForward) 0x0000 (NoSymbol) 0x1008ff90 (XF86MailForward) 242 0x1008ff77 (XF86Save) 0x0000 (NoSymbol) 0x1008ff77 (XF86Save) 243 0x1008ff5b (XF86Documents) 0x0000 (NoSymbol) 0x1008ff5b (XF86Documents) 244 0x1008ff93 (XF86Battery) 0x0000 (NoSymbol) 0x1008ff93 (XF86Battery) 245 0x1008ff94 (XF86Bluetooth) 0x0000 (NoSymbol) 0x1008ff94 (XF86Bluetooth) 246 0x1008ff95 (XF86WLAN) 0x0000 (NoSymbol) 0x1008ff95 (XF86WLAN) 247 248 249 250 251 252 253 254 0x1008ffb4 (XF86WWAN) 0x0000 (NoSymbol) 0x1008ffb4 (XF86WWAN) 255 0x1008ffb5 (XF86RFKill) 0x0000 (NoSymbol) 0x1008ffb5 (XF86RFKill)



[spiano@localhost work]$ xmodmap -pke

keycode 8 = keycode 9 = Escape NoSymbol Escape keycode 10 = 1 exclam 1 exclam onesuperior exclamdown keycode 11 = 2 at 2 quotedbl twosuperior oneeighth keycode 12 = 3 numbersign 3 sterling threesuperior sterling keycode 13 = 4 dollar 4 dollar EuroSign onequarter keycode 14 = 5 percent 5 percent onehalf threeeighths keycode 15 = 6 asciicircum 6 asciicircum threequarters fiveeighths keycode 16 = 7 ampersand 7 ampersand braceleft seveneighths keycode 17 = 8 asterisk 8 asterisk bracketleft trademark keycode 18 = 9 parenleft 9 parenleft bracketright plusminus keycode 19 = 0 parenright 0 parenright braceright degree keycode 20 = minus underscore minus underscore backslash questiondown keycode 21 = equal plus equal plus dead_cedilla dead_ogonek keycode 22 = BackSpace BackSpace BackSpace BackSpace keycode 23 = Tab ISO_Left_Tab Tab ISO_Left_Tab keycode 24 = q Q q Q at Greek_OMEGA keycode 25 = w W w W lstroke Lstroke keycode 26 = e E e E e E keycode 27 = r R r R paragraph registered keycode 28 = t T t T tslash Tslash keycode 29 = y Y y Y leftarrow yen keycode 30 = u U u U downarrow uparrow keycode 31 = i I i I rightarrow idotless keycode 32 = o O o O oslash Oslash keycode 33 = p P p P thorn THORN keycode 34 = bracketleft braceleft bracketleft braceleft dead_diaeresis dead_abovering keycode 35 = bracketright braceright bracketright braceright dead_tilde dead_macron keycode 36 = Return NoSymbol Return keycode 37 = Control_L NoSymbol Control_L keycode 38 = a A a A ae AE keycode 39 = s S s S ssharp section keycode 40 = d D d D eth ETH keycode 41 = f F f F dstroke ordfeminine keycode 42 = g G g G eng ENG keycode 43 = h H h H hstroke Hstroke keycode 44 = j J j J dead_hook dead_horn keycode 45 = k K k K kra ampersand keycode 46 = l L l L lstroke Lstroke keycode 47 = semicolon colon semicolon colon dead_acute dead_doubleacute keycode 48 = apostrophe quotedbl apostrophe at dead_circumflex dead_caron keycode 49 = grave asciitilde grave notsign bar bar keycode 50 = Shift_L NoSymbol Shift_L keycode 51 = backslash bar numbersign asciitilde dead_grave dead_breve keycode 52 = z Z z Z guillemotleft less keycode 53 = x X x X guillemotright greater keycode 54 = c C c C cent copyright keycode 55 = v V v V leftdoublequotemark leftsinglequotemark keycode 56 = b B b B rightdoublequotemark rightsinglequotemark keycode 57 = n N n N n N keycode 58 = m M m M mu masculine keycode 59 = comma less comma less horizconnector multiply keycode 60 = period greater period greater periodcentered division keycode 61 = slash question slash question dead_belowdot dead_abovedot keycode 62 = Shift_R NoSymbol Shift_R keycode 63 = KP_Multiply KP_Multiply KP_Multiply KP_Multiply KP_Multiply KP_Multiply XF86ClearGrab KP_Multiply KP_Multiply XF86ClearGrab keycode 64 = Alt_L Meta_L Alt_L Meta_L keycode 65 = space NoSymbol space keycode 66 = Caps_Lock NoSymbol Caps_Lock keycode 67 = F1 F1 F1 F1 F1 F1 XF86Switch_VT_1 F1 F1 XF86Switch_VT_1 keycode 68 = F2 F2 F2 F2 F2 F2 XF86Switch_VT_2 F2 F2 XF86Switch_VT_2 keycode 69 = F3 F3 F3 F3 F3 F3 XF86Switch_VT_3 F3 F3 XF86Switch_VT_3 keycode 70 = F4 F4 F4 F4 F4 F4 XF86Switch_VT_4 F4 F4 XF86Switch_VT_4 keycode 71 = F5 F5 F5 F5 F5 F5 XF86Switch_VT_5 F5 F5 XF86Switch_VT_5 keycode 72 = F6 F6 F6 F6 F6 F6 XF86Switch_VT_6 F6 F6 XF86Switch_VT_6 keycode 73 = F7 F7 F7 F7 F7 F7 XF86Switch_VT_7 F7 F7 XF86Switch_VT_7 keycode 74 = F8 F8 F8 F8 F8 F8 XF86Switch_VT_8 F8 F8 XF86Switch_VT_8 keycode 75 = F9 F9 F9 F9 F9 F9 XF86Switch_VT_9 F9 F9 XF86Switch_VT_9 keycode 76 = F10 F10 F10 F10 F10 F10 XF86Switch_VT_10 F10 F10 XF86Switch_VT_10 keycode 77 = Num_Lock NoSymbol Num_Lock keycode 78 = Scroll_Lock NoSymbol Scroll_Lock keycode 79 = KP_Home KP_7 KP_Home KP_7 keycode 80 = KP_Up KP_8 KP_Up KP_8 keycode 81 = KP_Prior KP_9 KP_Prior KP_9 keycode 82 = KP_Subtract KP_Subtract KP_Subtract KP_Subtract KP_Subtract KP_Subtract XF86Prev_VMode KP_Subtract KP_Subtract XF86Prev_VMode keycode 83 = KP_Left KP_4 KP_Left KP_4 keycode 84 = KP_Begin KP_5 KP_Begin KP_5 keycode 85 = KP_Right KP_6 KP_Right KP_6 keycode 86 = KP_Add KP_Add KP_Add KP_Add KP_Add KP_Add XF86Next_VMode KP_Add KP_Add XF86Next_VMode keycode 87 = KP_End KP_1 KP_End KP_1 keycode 88 = KP_Down KP_2 KP_Down KP_2 keycode 89 = KP_Next KP_3 KP_Next KP_3 keycode 90 = KP_Insert KP_0 KP_Insert KP_0 keycode 91 = KP_Delete KP_Decimal KP_Delete KP_Decimal keycode 92 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift keycode 93 = keycode 94 = less greater backslash bar bar brokenbar bar brokenbar keycode 95 = F11 F11 F11 F11 F11 F11 XF86Switch_VT_11 F11 F11 XF86Switch_VT_11 keycode 96 = F12 F12 F12 F12 F12 F12 XF86Switch_VT_12 F12 F12 XF86Switch_VT_12 keycode 97 = keycode 98 = Katakana NoSymbol Katakana keycode 99 = Hiragana NoSymbol Hiragana keycode 100 = Henkan_Mode NoSymbol Henkan_Mode keycode 101 = Hiragana_Katakana NoSymbol Hiragana_Katakana keycode 102 = Muhenkan NoSymbol Muhenkan keycode 103 = keycode 104 = KP_Enter NoSymbol KP_Enter keycode 105 = Control_R NoSymbol Control_R keycode 106 = KP_Divide KP_Divide KP_Divide KP_Divide KP_Divide KP_Divide XF86Ungrab KP_Divide KP_Divide XF86Ungrab keycode 107 = Print Sys_Req Print Sys_Req keycode 108 = Alt_R Meta_R ISO_Level3_Shift Multi_key keycode 109 = Linefeed NoSymbol Linefeed keycode 110 = Home NoSymbol Home keycode 111 = Up NoSymbol Up keycode 112 = Prior NoSymbol Prior keycode 113 = Left NoSymbol Left keycode 114 = Right NoSymbol Right keycode 115 = End NoSymbol End keycode 116 = Down NoSymbol Down keycode 117 = Next NoSymbol Next keycode 118 = Insert NoSymbol Insert keycode 119 = Delete NoSymbol Delete keycode 120 = keycode 121 = XF86AudioMute NoSymbol XF86AudioMute keycode 122 = XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume keycode 123 = XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume keycode 124 = XF86PowerOff NoSymbol XF86PowerOff keycode 125 = KP_Equal NoSymbol KP_Equal keycode 126 = plusminus NoSymbol plusminus keycode 127 = Pause Break Pause Break keycode 128 = XF86LaunchA NoSymbol XF86LaunchA keycode 129 = KP_Decimal KP_Decimal KP_Decimal KP_Decimal keycode 130 = Hangul NoSymbol Hangul keycode 131 = Hangul_Hanja NoSymbol Hangul_Hanja keycode 132 = keycode 133 = Super_L NoSymbol Super_L keycode 134 = Super_R NoSymbol Super_R keycode 135 = Menu NoSymbol Menu keycode 136 = Cancel NoSymbol Cancel keycode 137 = Redo NoSymbol Redo keycode 138 = SunProps NoSymbol SunProps keycode 139 = Undo NoSymbol Undo keycode 140 = SunFront NoSymbol SunFront keycode 141 = XF86Copy NoSymbol XF86Copy keycode 142 = XF86Open NoSymbol XF86Open keycode 143 = XF86Paste NoSymbol XF86Paste keycode 144 = Find NoSymbol Find keycode 145 = XF86Cut NoSymbol XF86Cut keycode 146 = Help NoSymbol Help keycode 147 = XF86MenuKB NoSymbol XF86MenuKB keycode 148 = XF86Calculator NoSymbol XF86Calculator keycode 149 = keycode 150 = XF86Sleep NoSymbol XF86Sleep keycode 151 = XF86WakeUp NoSymbol XF86WakeUp keycode 152 = XF86Explorer NoSymbol XF86Explorer keycode 153 = XF86Send NoSymbol XF86Send keycode 154 = keycode 155 = XF86Xfer NoSymbol XF86Xfer keycode 156 = XF86Launch1 NoSymbol XF86Launch1 keycode 157 = XF86Launch2 NoSymbol XF86Launch2 keycode 158 = XF86WWW NoSymbol XF86WWW keycode 159 = XF86DOS NoSymbol XF86DOS keycode 160 = XF86ScreenSaver NoSymbol XF86ScreenSaver keycode 161 = XF86RotateWindows NoSymbol XF86RotateWindows keycode 162 = XF86TaskPane NoSymbol XF86TaskPane keycode 163 = XF86Mail NoSymbol XF86Mail keycode 164 = XF86Favorites NoSymbol XF86Favorites keycode 165 = XF86MyComputer NoSymbol XF86MyComputer keycode 166 = XF86Back NoSymbol XF86Back keycode 167 = XF86Forward NoSymbol XF86Forward keycode 168 = keycode 169 = XF86Eject NoSymbol XF86Eject keycode 170 = XF86Eject XF86Eject XF86Eject XF86Eject keycode 171 = XF86AudioNext NoSymbol XF86AudioNext keycode 172 = XF86AudioPlay XF86AudioPause XF86AudioPlay XF86AudioPause keycode 173 = XF86AudioPrev NoSymbol XF86AudioPrev keycode 174 = XF86AudioStop XF86Eject XF86AudioStop XF86Eject keycode 175 = XF86AudioRecord NoSymbol XF86AudioRecord keycode 176 = XF86AudioRewind NoSymbol XF86AudioRewind keycode 177 = XF86Phone NoSymbol XF86Phone keycode 178 = keycode 179 = XF86Tools NoSymbol XF86Tools keycode 180 = XF86HomePage NoSymbol XF86HomePage keycode 181 = XF86Reload NoSymbol XF86Reload keycode 182 = XF86Close NoSymbol XF86Close keycode 183 = keycode 184 = keycode 185 = XF86ScrollUp NoSymbol XF86ScrollUp keycode 186 = XF86ScrollDown NoSymbol XF86ScrollDown keycode 187 = parenleft NoSymbol parenleft keycode 188 = parenright NoSymbol parenright keycode 189 = XF86New NoSymbol XF86New keycode 190 = Redo NoSymbol Redo keycode 191 = XF86Tools NoSymbol XF86Tools keycode 192 = XF86Launch5 NoSymbol XF86Launch5 keycode 193 = XF86Launch6 NoSymbol XF86Launch6 keycode 194 = XF86Launch7 NoSymbol XF86Launch7 keycode 195 = XF86Launch8 NoSymbol XF86Launch8 keycode 196 = XF86Launch9 NoSymbol XF86Launch9 keycode 197 = keycode 198 = XF86AudioMicMute NoSymbol XF86AudioMicMute keycode 199 = XF86TouchpadToggle NoSymbol XF86TouchpadToggle keycode 200 = XF86TouchpadOn NoSymbol XF86TouchpadOn keycode 201 = XF86TouchpadOff NoSymbol XF86TouchpadOff keycode 202 = keycode 203 = Mode_switch NoSymbol Mode_switch keycode 204 = NoSymbol Alt_L NoSymbol Alt_L keycode 205 = NoSymbol Meta_L NoSymbol Meta_L keycode 206 = NoSymbol Super_L NoSymbol Super_L keycode 207 = NoSymbol Hyper_L NoSymbol Hyper_L keycode 208 = XF86AudioPlay NoSymbol XF86AudioPlay keycode 209 = XF86AudioPause NoSymbol XF86AudioPause keycode 210 = XF86Launch3 NoSymbol XF86Launch3 keycode 211 = XF86Launch4 NoSymbol XF86Launch4 keycode 212 = XF86LaunchB NoSymbol XF86LaunchB keycode 213 = XF86Suspend NoSymbol XF86Suspend keycode 214 = XF86Close NoSymbol XF86Close keycode 215 = XF86AudioPlay NoSymbol XF86AudioPlay keycode 216 = XF86AudioForward NoSymbol XF86AudioForward keycode 217 = keycode 218 = Print NoSymbol Print keycode 219 = keycode 220 = XF86WebCam NoSymbol XF86WebCam keycode 221 = keycode 222 = keycode 223 = XF86Mail NoSymbol XF86Mail keycode 224 = XF86Messenger NoSymbol XF86Messenger keycode 225 = XF86Search NoSymbol XF86Search keycode 226 = XF86Go NoSymbol XF86Go keycode 227 = XF86Finance NoSymbol XF86Finance keycode 228 = XF86Game NoSymbol XF86Game keycode 229 = XF86Shop NoSymbol XF86Shop keycode 230 = keycode 231 = Cancel NoSymbol Cancel keycode 232 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown keycode 233 = XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp keycode 234 = XF86AudioMedia NoSymbol XF86AudioMedia keycode 235 = XF86Display NoSymbol XF86Display keycode 236 = XF86KbdLightOnOff NoSymbol XF86KbdLightOnOff keycode 237 = XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown keycode 238 = XF86KbdBrightnessUp NoSymbol XF86KbdBrightnessUp keycode 239 = XF86Send NoSymbol XF86Send keycode 240 = XF86Reply NoSymbol XF86Reply keycode 241 = XF86MailForward NoSymbol XF86MailForward keycode 242 = XF86Save NoSymbol XF86Save keycode 243 = XF86Documents NoSymbol XF86Documents keycode 244 = XF86Battery NoSymbol XF86Battery keycode 245 = XF86Bluetooth NoSymbol XF86Bluetooth keycode 246 = XF86WLAN NoSymbol XF86WLAN keycode 247 = keycode 248 = keycode 249 = keycode 250 = keycode 251 = keycode 252 = keycode 253 = keycode 254 = XF86WWAN NoSymbol XF86WWAN keycode 255 = XF86RFKill NoSymbol XF86RFKill





Key items:
keycode 37 = Control_L NoSymbol Control_L

and
keycode 66 = Caps_Lock NoSymbol Caps_Lock





[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)




Hm. Looks like there's a "control" modifier to which both Control_L and Control_R are mapped. Presumably, Control_L = Left Control Key and Control_R = Right Control Key.




I'll look at the man page (via running
man xmodmap
).


Excerpts from the man page:

NAME xmodmap - utility for modifying keymaps and pointer button mappings in X SYNOPSIS xmodmap [-options ...] [filename] DESCRIPTION The xmodmap program is used to edit and display the keyboard modifier map and keymap table that are used by client applications to convert event keycodes into keysyms. It is usually run from the user's session startup script to configure the keyboard according to personal tastes. OPTIONS [...] -n This option indicates that xmodmap should not change the map- pings, but should display what it would do, like make(1) does when given this option. -e expression This option specifies an expression to be executed. Any number of expressions may be specified from the command line. [...] -pk This option indicates that the current keymap table should be printed on the standard output. -pke This option indicates that the current keymap table should be printed on the standard output in the form of expressions that can be fed back to xmodmap. [...] The filename specifies a file containing xmodmap expressions to be exe- cuted. This file is usually kept in the user's home directory with a name like .xmodmaprc. EXPRESSION GRAMMAR The xmodmap program reads a list of expressions and parses them all before attempting to execute any of them. This makes it possible to refer to keysyms that are being redefined in a natural way without hav- ing to worry as much about name conflicts. The list of keysym names may be found in the header file <X11/keysymdef.h> (without the XK_ prefix), supplemented by the keysym database /usr/share/X11/XKeysymDB. Keysyms matching Unicode charac- ters may be specified as "U0020" to "U007E" and "U00A0" to "U10FFFF" for all possible Unicode characters. keycode NUMBER = KEYSYMNAME ... The list of keysyms is assigned to the indicated keycode (which may be specified in decimal, hex or octal and can be determined by running the xev program). Up to eight keysyms may be attached to a key, however the last four are not used in any major X server implementation. The first keysym is used when no modifier key is pressed in conjunction with this key, the second with Shift, the third when the Mode_switch key is used with this key and the fourth when both the Mode_switch and Shift keys are used. [...] keysym KEYSYMNAME = KEYSYMNAME ... The KEYSYMNAME on the left hand side is translated into match- ing keycodes used to perform the corresponding set of keycode expressions. Note that if the same keysym is bound to multiple keys, the expression is executed for each matching keycode. clear MODIFIERNAME This removes all entries in the modifier map for the given mod- ifier, where valid name are: Shift, Lock, Control, Mod1, Mod2, Mod3, Mod4, and Mod5 (case does not matter in modifier names, although it does matter for all other names). For example, ``clear Lock'' will remove all any keys that were bound to the shift lock modifier. add MODIFIERNAME = KEYSYMNAME ... This adds all keys containing the given keysyms to the indi- cated modifier map. The keysym names are evaluated after all input expressions are read to make it easy to write expressions to swap keys (see the EXAMPLES section). remove MODIFIERNAME = KEYSYMNAME ... This removes all keys containing the given keysyms from the indicated modifier map. Unlike add, the keysym names are eval- uated as the line is read in. This allows you to remove keys from a modifier without having to worry about whether or not they have been reassigned. [...] Lines that begin with an exclamation point (!) are taken as comments. If you want to change the binding of a modifier key, you must also remove it from the appropriate modifier map. EXAMPLES Many pointers are designed such that the first button is pressed using the index finger of the right hand. People who are left-handed fre- quently find that it is more comfortable to reverse the button codes that get generated so that the primary button is pressed using the index finger of the left hand. This could be done on a 3 button pointer as follows: % xmodmap -e "pointer = 3 2 1" [...] One of the more irritating differences between keyboards is the loca- tion of the Control and CapsLock keys. A common use of xmodmap is to swap these two keys as follows: ! ! Swap Caps_Lock and Control_L ! remove Lock = Caps_Lock remove Control = Control_L keysym Control_L = Caps_Lock keysym Caps_Lock = Control_L add Lock = Caps_Lock add Control = Control_L This example can be run again to swap the keys back to their previous assignments. The keycode command is useful for assigning the same keysym to multiple keycodes. Although unportable, it also makes it possible to write scripts that can reset the keyboard to a known state. The following script sets the backspace key to generate Delete (as shown above), flushes all existing caps lock bindings, makes the CapsLock key be a control key, make F5 generate Escape, and makes Break/Reset be a shift lock. ! ! On the HP, the following keycodes have key caps as listed: ! ! 101 Backspace ! 55 Caps ! 14 Ctrl ! 15 Break/Reset ! 86 Stop ! 89 F5 ! keycode 101 = Delete keycode 55 = Control_R clear Lock add Control = Control_R keycode 89 = Escape keycode 15 = Caps_Lock add Lock = Caps_Lock [...] AUTHOR Jim Fulton, MIT X Consortium, rewritten from an earlier version by David Rosenthal of Sun Microsystems.




Notes:
- "pointer" here refers to a mouse or a similar tool.
- the xmodmap program parses all the expressions first before attempting to execute any of them.
- can put a list of xmodmap expressions into a file called .xmodmaprc and save it in the user's home directory. 1 expression per line.
- Lines that begin with an exclamation point (!) are taken as comments.
-
clear Lock
will remove all keys that are bound to the shift lock modifier (currently, this is the Caps Lock key).
- Each physical key has a keycode (a numeric value). This keycode has an associated list of keysymbols (keysyms). Keysyms represent numeric character values. The first keysym is used when no modifier key is pressed in conjunction with this key, the second with Shift, the third when the Mode_switch key is used with this key, and the fourth when both the Mode_switch and Shift keys are used.


I'm not going to use the given example for swapping the Control and Caps Lock keys. I want to specifically set the physical keys to Control and Caps Lock, and I want to specify that this alteration will occur on login (i.e. in .xmodmaprc).



Suggestion from:
stackoverflow.com/questions/2176532/how-to-map-caps-lock-key-in-vim
Author: Dan Andreatta
Date: Feb 1 '10
- The command
xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'
will map Esc to the Caps Lock key.




From earlier:
- keycode 37 is currently Control_L
- keycode 66 is currently Caps_Lock


Escape is not one of the special modifiers.



[spiano@localhost work]$ xmodmap -e 'clear Lock' -e 'keycode 0x37 = Caps_Lock' -e 'keycode 0x66 = Control_L'



Hm. Didn't work.

Ah. I specified hex numbers, not decimal ones. The character 'v' is now a Caps Lock that won't turn back off. I'm using Right-Click + Paste instead of Control-V.


Scroll back up, find the original values for 0x37 and 0x66.

16 0x0037 (7) 0x0026 (ampersand) 0x0037 (7) 0x0026 (ampersand) 0x007b (braceleft) 0x0ac6 (seveneighths) 41 0x0066 (f) 0x0046 (F) 0x0066 (f) 0x0046 (F) 0x01f0 (dstroke) 0x00aa (ordfeminine) [...] keycode 55 = v V v V leftdoublequotemark leftsinglequotemark



Hm. The 'f' key works fine. 'F'.
The & key works. '7'.

Caps Lock still works. Also turns off.

Control_L still works.



Run
xmodmap -pke

to see the keycode-to-keysym mapping.

I note that:
- keycode 37 = Control_L NoSymbol Control_L
- keycode 55 = Caps_Lock
- keycode 66 = Caps_Lock NoSymbol Caps_Lock
- keycode 102 = Control_L NoSymbol Control_L





From earlier, these used to be:
- keycode 37 = Control_L NoSymbol Control_L
- keycode 55 = v V v V leftdoublequotemark leftsinglequotemark
- keycode 66 = Caps_Lock NoSymbol Caps_Lock
- keycode 102 = Muhenkan NoSymbol Muhenkan



[spiano@localhost work]$ xmodmap -e 'keycode 55 = v V v V leftdoublequotemark leftsinglequotemark'


Run
xmodmap -pke

to see the keycode-to-keysym mapping.

I see that:
- keycode 55 = v V v V leftdoublequotemark leftsinglequotemark

Control-V now works properly again.


[spiano@localhost work]$ xmodmap -e 'keycode 102 = Muhenkan NoSymbol Muhenkan'


Run
xmodmap -pke

to see the keycode-to-keysym mapping.
I see that:
- keycode 102 = Muhenkan NoSymbol Muhenkan



Future: Where do the original keysym settings come from? How might one find out all the possible keysym names?
- Ah. From the man page excerpts:
The list of keysym names may be found in the header file <X11/keysymdef.h> (without the XK_ prefix), supplemented by the keysym database /usr/share/X11/XKeysymDB.




Let's try again.



Original settings:
From earlier, these used to be:
- keycode 37 = Control_L NoSymbol Control_L
- keycode 66 = Caps_Lock NoSymbol Caps_Lock

[spiano@localhost work]$ xmodmap -e 'keycode 37 = Caps_Lock NoSymbol Caps_Lock' -e 'keycode 66 = Control_L NoSymbol Control_L'



Run
xmodmap -pke

to see the keycode-to-keysym mapping.
I see that:
- keycode 37 = Caps_Lock NoSymbol Caps_Lock
- keycode 66 = Control_L NoSymbol Control_L

Hm. Control_L works as a Caps Lock. Toggles on and off. But Caps Lock key does not work as Control. Let's check the modifier map.



[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock control Caps_Lock (0x25), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)




Hm.


Result from earlier:

[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)








Let's experiment.


[spiano@localhost work]$ xmodmap -e 'remove Control = Control_L'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock control Caps_Lock (0x25), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)





[spiano@localhost work]$ xmodmap -e 'remove Control = Caps_Lock'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock control Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)





[spiano@localhost work]$ xmodmap -e 'add Control = Control_L'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock control Control_L (0x42), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)




Ah. Works now. So: Because I mapped the physical Caps_Lock key to the Control_L keysym, and the physical Control_L key to the Caps_Lock keysym, somehow the modifier map was altered. I then had to change the "control" modifier list by removing the Caps_Lock keysym and adding the Control_L keysym. For some reason, the physical Control_L key works fine as the Caps_Lock keysym without being present in the modifier map.







Now: I'll power cycle Shovel, and check that the original keyboard settings are restored.


Shovel turned off and on again.


Yup. Original settings for Caps Lock and Control_L have been restored.



Thoughts: When remapping keys,
- Back up any data on the computer before starting. You could make the computer unusable and have to reinstall the entire operating system.
- Archive key settings before starting.
- Plan out the changes and commands.
- Plan out the tests for success/failure before executing the changes.
- Change one key at a time, testing as you go.




I've backed up the data on Shovel.


Next: Archive current key settings. (These are the original key settings.)



From the excerpts from the man page, I know that the -pke option for the
xmodmap
command indicates that:
"the current keymap table should be printed on the standard output in the form of expressions that can be fed back to xmodmap."

So: Using this option, I can produce an archive of the current key settings.

I should also test that restoring the archive works.



[spiano@localhost work]$ xmodmap -pke > key_settings.txt


[spiano@localhost work]$ head -10 key_settings.txt

keycode 8 = keycode 9 = Escape NoSymbol Escape keycode 10 = 1 exclam 1 exclam onesuperior exclamdown keycode 11 = 2 at 2 quotedbl twosuperior oneeighth keycode 12 = 3 numbersign 3 sterling threesuperior sterling keycode 13 = 4 dollar 4 dollar EuroSign onequarter keycode 14 = 5 percent 5 percent onehalf threeeighths keycode 15 = 6 asciicircum 6 asciicircum threequarters fiveeighths keycode 16 = 7 ampersand 7 ampersand braceleft seveneighths keycode 17 = 8 asterisk 8 asterisk bracketleft trademark




Cool.

I'll change a setting. Then I'll restore from archive.

I'll map F5 to 'a'.

In the output of
xmodmap -pke
I find that:
- keycode 38 = a A a A ae AE
- keycode 71 = F5 F5 F5 F5 F5 F5 XF86Switch_VT_5 F5 F5 XF86Switch_VT_5


[spiano@localhost work]$ xmodmap -e 'keycode 71 = a A b'



Ok:
- F5 key now produces 'a'
- Shift + F5 now produces 'A'.
- However, Alt + F5 does not produce 'b'. I had thought the "Mode_switch key" in the man page referred to Alt.
-- It might refer to Option, but Option + F5 currently performs a splashy GUI display operation, which presumably takes precedence (assuming that Mode_switch key == Option).

In the output of
xmodmap -pke
I find that:
- keycode 71 = a A b B



Now, let's restore.


[spiano@localhost work]$ xmodmap key_settings.txt



Computer input (keyboard, mouse) jammed for about 10-15 seconds while the command was running.



In the output of
xmodmap -pke
I find that:
- keycode 71 = F5 F5 F5 F5 F5 F5 XF86Switch_VT_5 F5 F5 XF86Switch_VT_5
- everything else in the output looks as expected, plus I can type these notes without any trouble.





Next: I'll try to execute a change on boot.



[spiano@localhost work]$ ls -1a ~

.
..
.bash_history
.bash_logout
.bash_profile
.bashrc
.cache
.config
core.5594
.dbus
Desktop
Documents
Downloads
.esd_auth
.gnupg
.ICEauthority
.lesshst
.local
.mozilla
Music
Pictures
.pki
Public
.ssh
stuff
Templates
Videos
.viminfo



No .xmodmaprc file currently exists in the home directory.


Data for .xmodmaprc:
keycode 71 = a A




change to home directory:
[spiano@localhost work]$ cd ~



create .xmodmaprc:
[spiano@localhost ~]$ touch .xmodmaprc



edit .xmodmaprc:
[spiano@localhost ~]$ vim .xmodmaprc



print .xmodmaprc:
[spiano@localhost ~]$ cat .xmodmaprc

keycode 71 = a A



Currently, F5 produces nothing.


I'll test that running the command
xmodmap .xmodmaprc
in the home directory sets F5 to produce 'a'.


[spiano@localhost work]$ xmodmap .xmodmaprc



aaa.


Yup, F5 now produces 'a'.


Next: Place the command
xmodmap .xmodmaprc
in my user's startup script (which is run when I log in).



I know from previous experience that:
- .bash_profile
- .bashrc
are involved in the Bash shell startup process.


[some searching occurs here]


Source:
www.joshstaiger.org/archives/2005/07/bash_profile_vs.html
Author: Josh Staiger
Title: .bash_profile vs .bashrc

What is a login or non-login shell?

When you login (type username and password) via console, either sitting at the machine, or remotely via ssh:
.bash_profile
is executed to configure your shell before the initial command prompt.

But, if you've already logged into your machine and open a new terminal window (xterm) inside Gnome or KDE, then
.bashrc
is executed before the window command prompt.
.bashrc
is also run when you start a new bash instance by typing
/bin/bash
in a terminal.

Why two different files?

Say, you'd like to print some lengthy diagnostic information about your machine each time you login (load average, memory usage, current users, etc). You only want to see it on login, so you only want to place this in your
.bash_profile
. If you put it in your
.bashrc
, you'd see it every time you open a new terminal window.



Ok. I'll use .bash_profile. I only need keycodes to be set once, when I log in.

Looking in my .bash_profile, I note that it loads .bashrc as part of its operation anyway.

So: Add this line:
xmodmap .xmodmaprc

at the end of ~/.bash_profile.



[spiano@localhost ~]$ cat .bash_profile

# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH xmodmap .xmodmaprc






Next: Power cycle Shovel. See if F5 has been set to produce 'a'.



Power cycle done. Log in.


Nope. F5 does not produce any character.


Hm. Open a terminal.


Still nope.


[spiano@localhost ~]$ source .bash_profile




Yup. Now it does. Hm.


Ah. Evidently the GUI login on CentOS doesn't run the .bash_profile file.



On skimming through the previous article
New computer: Shovel
I find:

In the Software Selection interface, I have chosen:
- GNOME Desktop



[some searching occurs here]



Source:
access.redhat.com/discussions/1342633
Title: GNOME logins dont run .bash_profile in RHEL7
Author: Robert Krátký
Date: 6 February 2015 3:47 PM

The
~/.bash_profile
file is (should) only be sourced when Bash is started in interactive, login mode. When you're logging in graphically (using GDM or other display manager), the script that launches the session sources the
~/.profile
file.



CentOS 7 is downstream from RHEL7, so this will probably work.


Data for
~/.profile
:
# .profile if [ -f ~/.bash_profile ]; then . ~/.bash_profile fi



Create ~/.profile and copy this data into it.


[spiano@localhost ~]$ vim .profile


[spiano@localhost ~]$ cat .profile

# .profile if [ -f ~/.bash_profile ]; then . ~/.bash_profile fi




This means that:
- .bashrc is run when each new shell is created (when you're already logged in)
- .bash_profile is the login script (run once when you log in)
- .profile is the GUI login script for GNOME (run once when you log in via the CentOS GUI).



Let's see if it works.




Power cycle done. Log in.


Nope. F5 does not produce any character.


Open a terminal.


Still nope.



Hm.



In Applications / System Tools / Settings / Details / About, I find:
- Gnome Version 3.28.2




Source:
unix.stackexchange.com/questions/172179/gnome-shell-running-shell-script-after-session-starts
edited Aug 23 '17 at 21:08
Drew Barrett
answered Dec 8 '14 at 22:23
Marcelo

You can use the program gnome-session-properties. Just execute it from your shell prompt (gnome-terminal):

$ gnome-session-properties

This will open a GUI where you can configure (i.e., add, edit, remove, enable and disable) startup programs.

Nice and easy. Enjoy.

Update: As noted by don_crissti (thanks) in the comments below, the gnome-session-properties startup programs functionality has migrated to gnome-tweak-tool since Gnome 3.12 (which btw is a great tool, but a little messier as it concentrates just too many functions). So, for versions 3.12 and above, this is the new place to look.

OBS: And btw, using this method, you don't need to create a .desktop file, you can simply specify the command line of the /home/neko/bin/auto_stuff.sh script you created (or any other script or command you want).




Run
gnome-session-properties
.

It opens up a GUI program called "Startup Applications Preferences". It does indeed appear to allow a user to set programs to run on startup.

Can't see invisible files (e.g. .profile) in this GUI program.


Rename .profile to GNOME_login_bash_script.sh.

[spiano@localhost ~]$ mv .profile GNOME_login_bash_script.sh



Click Add:
- Name: GNOME_login_bash_script.sh
- Command: /home/spiano/GNOME_login_bash_script.sh
- Comment: Run bash script on login



Let's see if this works.




Power cycle done. Log in.


Nope. F5 does not produce any character.


Open a terminal. Still nope.



Edit GNOME_login_bash_script.sh so that it uses absolute paths.



[spiano@localhost ~]$ pwd

/home/spiano

[spiano@localhost ~]$ vim GNOME_login_bash_script.sh


[spiano@localhost ~]$ cat GNOME_login_bash_script.sh

# .profile if [ -f /home/spiano/.bash_profile ]; then . /home/spiano/.bash_profile fi






Let's see if this works.




Power cycle done. Log in.

No. F5 does not produce any character. Open a terminal. No.





My GNOME version (3.28.2) is greater than the one mentioned in the excerpt above (3.12).

I'll try
gnome-tweak-tool
.


[spiano@localhost ~]$ gnome-tweak-tool

bash: gnome-tweak-tool: command not found...




Hm.


On running
gnome-session-properties
again, and looking at the list of Startup Programs, I don't find my script listed.



[spiano@localhost ~]$ vim GNOME_login_bash_script.sh


[spiano@localhost ~]$ cat GNOME_login_bash_script.sh

if [ -f /home/spiano/.xmodmaprc ]; then xmodmap /home/spiano/.xmodmaprc fi




Run
gnome-session-properties
. In the "Startup Applications Preferences" GUI program, click Add:
- Name: GNOME_login_bash_script
- Command: /home/spiano/GNOME_login_bash_script.sh
- Comment: Run bash script on login
Click Close.



Run
gnome-session-properties
. In the "Startup Applications Preferences" GUI program, look through the list.
- GNOME_login_bash_script is not present.



Try without underscores (the other names don't have underscores).


Run
gnome-session-properties
. In the "Startup Applications Preferences" GUI program, click Add:
- Name: GNOME login bash script
- Command: /home/spiano/GNOME_login_bash_script.sh
- Comment: Run bash script on login
Click Close.


Run
gnome-session-properties
. In the "Startup Applications Preferences" GUI program, look through the list.
- "GNOME login bash script" is not present.







Source:
ubuntuforums.org/showthread.php?t=1067101
Author: d2globalinc

HOWTO: Disable or Enable Gnome Session Startup Applications from Command Line

- As usual I am not responsible for you screwing up your install by using these instructions the wrong way! -

So I looked around, and just couldn't find out how to do this without using the GUI (Which by the way is SYSTEM->PREFERENCES->SESSIONS)

It looks like by default session startup options are located in the following directories:

/usr/share/gnome/autostart/
/usr/share/autostart/
/etc/xdg/autostart/
and then every user can have their own autostart options located in
~/.config/autostart/
(the above translates to: /home/<username>/.config/autostart/ )

So if you want to disable a startup option from command line you would just open a terminal window and remove or as I perfer - rename - the startup options corrisponding .desktop file. For example, to disable the check for new hardware on every login for every user - you could do this:

- Open a terminal window
- do the following:

Code:

sudo mv /etc/xdg/autostart/jockey-gtk.desktop /etc/xdg/autostart/jockey-gtk.orig

This will rename the jockey-gtk.desktop file (which is the New Hardware Detection Application in Ubuntu) to jockey-gtk.orig - which will disable it from starting up for all users when they login. Which was something I needed to do on a current project.

Anyway - I looked around, and I found methods for disabling startup services using the "sysv-rc-conf" package, but it was much harder to find any information about how to disable Gnome Session Startup applications without using the GUI - which was not an option for me in this case.

Hope this helps others!

Enjoy!

Shane Menshik
D2 GLOBAL INC
http://www.d2global.com





[spiano@localhost ~]$ ls -a1

.
..
.bash_history
.bash_logout
.bash_profile
.bashrc
.cache
.config
core.5594
.dbus
Desktop
Documents
Downloads
.esd_auth
GNOME_login_bash_script.sh
.gnupg
.ICEauthority
.lesshst
.local
.mozilla
Music
Pictures
.pki
Public
.ssh
stuff
Templates
Videos
.viminfo
.xmodmaprc

[spiano@localhost ~]$ file .config

.config: directory

[spiano@localhost ~]$ ls -1 .config

abrt
autostart
dconf
dleyna-server-service.conf
enchant
eog
evolution
gconf
gedit
gnome-boxes
gnome-control-center
gnome-initial-setup-done
gnome-session
goa-1.0
gtk-3.0
ibus
imsettings
libreoffice
mimeapps.list
nautilus
pulse
sealert.conf
totem
user-dirs.dirs
user-dirs.locale
vlc
yelp

[spiano@localhost ~]$ ls -1 .config/autostart

GNOME_login_bash_script.sh.desktop
sealertauto.desktop

[spiano@localhost ~]$ cat .config/autostart/GNOME_login_bash_script.sh.desktop

[Desktop Entry]
Type=Application
Exec=/home/spiano/GNOME_login_bash_script.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_GB]=GNOME login bash script
Name=GNOME_login_bash_script.sh
Comment[en_GB]=Run bash script on login
Comment=Run bash script on login



Hm.





[spiano@localhost ~]$ cat GNOME_login_bash_script.sh

if [ -f /home/spiano/.xmodmaprc ]; then xmodmap /home/spiano/.xmodmaprc fi


[spiano@localhost ~]$ ls -l GNOME_login_bash_script.sh

-rw-rw-r--. 1 spiano spiano 76 Mar 29 19:13 GNOME_login_bash_script.sh

[spiano@localhost ~]$ cat .config/autostart/sealertauto.desktop

[Desktop Entry]
Name=SELinux Troubleshooter
Exec=/usr/bin/seapplet
Comment=View & interpret SELinux denials
Encoding=UTF-8
Type=Application
StartupNotify=false
X-KDE-autostart-after=panel
Icon=setroubleshoot_icon
X-GNOME-Autostart-enabled=false

[spiano@localhost ~]$ ls -l /usr/bin/seapplet

-rwxr-xr-x. 1 root root 20240 Nov 2 16:12 /usr/bin/seapplet




Hm.



[spiano@localhost ~]$ mv .config/autostart/GNOME_login_bash_script.sh.desktop .config/autostart/GNOME_login_bash_script.desktop


[spiano@localhost ~]$ which bash

/usr/bin/bash

[spiano@localhost ~]$ vim GNOME_login_bash_script.sh


[spiano@localhost ~]$ cat GNOME_login_bash_script.sh

#!/usr/bin/bash if [ -f /home/spiano/.xmodmaprc ]; then xmodmap /home/spiano/.xmodmaprc fi


[spiano@localhost ~]$ chmod 744 GNOME_login_bash_script.sh


[spiano@localhost ~]$ ls -l GNOME_login_bash_script.sh

-rwxr--r--. 1 spiano spiano 92 Mar 29 19:47 GNOME_login_bash_script.sh





Let's see if this works.

Power cycle done. Log in.

Yes. F5 produces 'a'.

aaaaaaaaaaaaaaaaaaaa.


Cool.

Shift-F5?

AAAAAA.

Yup, produces 'A'.


Open a terminal. In terminal, F5 produces 'a' and Shift-F5 produces 'A'.


[spiano@localhost ~]$ ls -l .config/autostart/GNOME_login_bash_script.desktop

-rw-rw-r--. 1 spiano spiano 279 Mar 29 19:18 .config/autostart/GNOME_login_bash_script.desktop



Run
gnome-session-properties
. In the "Startup Applications Preferences" GUI program, look through the list.
- "GNOME login bash script" is present.


Excellent.



Evidently the permissions for the file GNOME_login_bash_script.sh were the problem. It didn't have "execute" permission, even from its owner (spiano).


I don't know if the name of the autostart file made any difference i.e. changing it from
GNOME_login_bash_script.sh.desktop
to
GNOME_login_bash_script.desktop.









Next: Choose final key settings:
- Plan out the changes and commands.
- Plan out the tests for success/failure before executing the changes.
- Change one key at a time, testing as you go.



Changes:
1) Set Caps_Lock key to perform the Control_L function. Make appropriate adjustment to modifier map for "control".
2) Set Control_L key to perform the Caps_Lock function. Make appropriate adjustment to modifier map for "lock".
3) Set F5 key to perform the Escape function.
4) Set Shift + Backspace key to perform the Delete function (i.e. delete next character).



Tests:
1) In a text editor: Use Caps_Lock + C to copy some text. Use Caps_Lock + V to paste it.
2) In a text editor: Press Control_L. Type some text. The characters should all be upper case.
3) In
vim
: Enter Insert Mode. Press F5 key to escape Insert Mode and re-enter Command Mode.
4) In a text editor: Type some text. Position the cursor in the middle of the text. Press Shift + Backspace. The character immediately after the cursor should be deleted.



Commands:


Each physical key has a keycode (a numeric value). This keycode has an associated list of keysymbols (keysyms). Keysyms represent particular character sequences. The first keysym is used when no modifier key is pressed in conjunction with this key, the second with Shift, the third when the Mode_switch key is used with this key, and the fourth when both the Mode_switch and Shift keys are used.



I'll construct some of the necessary commands:

View modifier map:
xmodmap -pm


Remove the Control_L keysym from the "control" modifier list.
xmodmap -e 'remove Control = Control_L'


Add the Control_L keysym to the "control" modifier list.
xmodmap -e 'add Control = Control_L'


Find the keycode(s) currently assigned to the Control_L keysym.
xmodmap -pke | grep Control_L


Find the keycode(s) to which the Caps_Lock keysym is currently assigned.
xmodmap -pke | grep Caps_Lock


Find the keycode(s) to which the F5 keysym is currently assigned.
xmodmap -pke | grep F5


Find the keycode(s) to which the 'a' keysym is currently assigned. Check for a space either side of the keysym character.
xmodmap -pke | grep ' a '


Find the keycode(s) to which the BackSpace keysym is currently assigned.
xmodmap -pke | grep BackSpace


Note: I read through the
xmodmap -pke
output to find some of the keysym names e.g. "BackSpace".

Remove the Caps_Lock keysym from the "lock" modifier list.
xmodmap -e 'remove Lock = Caps_Lock'


Add the Caps_Lock keysym to the "lock" modifier list.
xmodmap -e 'add Lock = Caps_Lock'


Find the keycode(s) to which the Delete keysym is currently assigned.
xmodmap -pke | grep Delete


Bind a keycode to a list of keysyms.
xmodmap -e 'keycode 71 = a A a A'








Check current keycodes:


[spiano@localhost work]$ xmodmap -pke | grep Control_L

keycode 37 = Control_L NoSymbol Control_L

[spiano@localhost work]$ xmodmap -pke | grep Caps_Lock
keycode 66 = Caps_Lock NoSymbol Caps_Lock


[spiano@localhost work]$ xmodmap -pke | grep F5


[spiano@localhost work]$ xmodmap -pke | grep ' a '

keycode 38 = a A a A ae AE
keycode 71 = a A a A

[spiano@localhost work]$ xmodmap -pke | grep BackSpace

keycode 22 = BackSpace BackSpace BackSpace BackSpace

[spiano@localhost work]$ xmodmap -pke | grep Delete

keycode 91 = KP_Delete KP_Decimal KP_Delete KP_Decimal
keycode 119 = Delete NoSymbol Delete

[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)




The F5 physical key is currently set to produce 'a'. Its keycode is 71.






Let's make the changes.


1) Set Caps_Lock key to perform the Control_L function. Make appropriate adjustment to modifier map for "control".

Remove the Caps_Lock keysym from the "lock" modifier list.

[spiano@localhost work]$ xmodmap -e 'remove Lock = Caps_Lock'


[spiano@localhost work]$ xmodmap -e 'keycode 66 = Control_L NoSymbol Control_L'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)


[spiano@localhost work]$ xmodmap -pke | grep Control_L

keycode 37 = Control_L NoSymbol Control_L
keycode 66 = Control_L NoSymbol Control_L





Test: 1) In a text editor: Use Caps_Lock + C to copy some text. Use Caps_Lock + V to paste it.


Didn't work.



[spiano@localhost work]$ xmodmap -e 'remove Control = Control_L'


[spiano@localhost work]$ xmodmap -e 'add Control = Control_L'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock control Control_L (0x25), Control_L (0x42), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)





I see that there are now two entries for Control_L in the "control" modifier list. One for each keycode, even though both keycodes have the same keysym.


Test: 1) In a text editor: Use Caps_Lock + C to copy some text. Use Caps_Lock + V to paste it.


some text. some text. some text. some text. some text. some text. some text. some text.


works. Caps_Lock key now functions as Control_L.







Next: 2) Set Control_L key to perform the Caps_Lock function. Make appropriate adjustment to modifier map for "lock".


Note: When I remove the Control binding for Control_L (and/or Caps_Lock), I can still use Control_R for Ctrl+C & Ctrl+V (copy and paste).



[spiano@localhost work]$ xmodmap -e 'remove Control = Control_L'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock control Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)s


[spiano@localhost work]$ xmodmap -e 'keycode 37 = Caps_Lock NoSymbol Caps_Lock'


[spiano@localhost work]$ xmodmap -e 'add Control = Control_L'


[spiano@localhost work]$ xmodmap -e 'add Lock = Caps_Lock'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x25) control Control_L (0x42), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)




Tests:
1) In a text editor: Use Caps_Lock + C to copy some text. Use Caps_Lock + V to paste it.
2) In a text editor: Press Control_L. Type some text. The characters should all be upper case.



some text. some text. some text. some text. some text. some text.

Test 1 passed.

SOME TEXT. SOME TEXT. SOME TEXT.

Test 2 passed.





Next: 3) Set F5 key to perform the Escape function.

No modifiers are involved.


[spiano@localhost work]$ xmodmap -pke | grep Escape

keycode 9 = Escape NoSymbol Escape

[spiano@localhost work]$ xmodmap -e 'keycode 71 = Escape NoSymbol Escape'




Test: 3) In
vim
: Enter Insert Mode. Press F5 key to escape Insert Mode and re-enter Command Mode.



Test 3 passed.






Final change: 4) Set Shift + Backspace key to perform the Delete function (i.e. delete next character).



I need to set the second keysym in the keysym list for BackSpace to be Delete.


[spiano@localhost work]$ xmodmap -pke | grep BackSpace

keycode 22 = BackSpace BackSpace BackSpace BackSpace

[spiano@localhost work]$ xmodmap -e 'keycode 22 = BackSpace Delete BackSpace BackSpace'





Test: 4) In a text editor: Type some text. Position the cursor in the middle of the text. Press Shift + Backspace. The character immediately after the cursor should be deleted.



some text. some text. text. soext. me text. some text. some text. some text. some t


Works. Test 4 passed.










Ok. Success. I'll assemble the command sequence, so that it can be placed in the startup script.




!
! On startup, make alterations to the keyboard layout.
! 1) Set Control_L key ("Control Left") to produce Caps_Lock effect.
! 2) Set Caps_Lock key to produce Control_L effect.
! 3) Set F5 key to produce Escape effect.
! 4) Set Shift + BackSpace to produce Delete effect (delete next character).
!
! Remove particular keysyms from the modifier lists.
!
remove Control = Control_L
remove Lock = Caps_Lock
!
! Assign keysym lists to keycodes.
!
keycode 37 = Caps_Lock NoSymbol Caps_Lock
keycode 66 = Control_L NoSymbol Control_L
!
! Add particular keysyms back into the modifier lists.
!
add Control = Control_L
add Lock = Caps_Lock
!
! Assign keysym lists to keycodes.
!
keycode 71 = Escape NoSymbol Escape
keycode 22 = BackSpace Delete BackSpace BackSpace







Put this command sequence into .xmodmaprc.



[spiano@localhost work]$ cat ~/.xmodmaprc

keycode 71 = a A

[spiano@localhost work]$ vim ~/.xmodmaprc


[spiano@localhost work]$ cat ~/.xmodmaprc

!
! On startup, make alterations to the keyboard layout.
! 1) Set Control_L key ("Control Left") to produce Caps_Lock effect.
! 2) Set Caps_Lock key to produce Control_L effect.
! 3) Set F5 key to produce Escape effect.
! 4) Set Shift + BackSpace to produce Delete effect (delete next character).
!
! Remove particular keysyms from the modifier lists.
!
remove Control = Control_L
remove Lock = Caps_Lock
!
! Assign keysym lists to keycodes.
!
keycode 37 = Caps_Lock NoSymbol Caps_Lock
keycode 66 = Control_L NoSymbol Control_L
!
! Add particular keysyms back into the modifier lists.
!
add Control = Control_L
add Lock = Caps_Lock
!
! Assign keysym lists to keycodes.
!
keycode 71 = Escape NoSymbol Escape
keycode 22 = BackSpace Delete BackSpace BackSpace





Perform computer backup again.







Test again before rebooting.



[spiano@localhost work]$ ls

key_settings.txt

[spiano@localhost work]$ xmodmap key_settings.txt



The computer ceased to accept keyboard/mouse input for about 10-15 seconds. I could move the mouse but I couldn't click or select.





[spiano@localhost work]$

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Control_L (0x25) control Caps_Lock (0x42), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)


The
xmodmap key_settings.txt
command altered the modifier table, although not on purpose. It swapped the Caps_Lock and Control_L keycodes again but kept the same keycodes in the same positions in the modifier lists.



Compare with the output from a little earlier:


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x25) control Control_L (0x42), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)





Tests:
- Caps_Lock key triggers Lock.
- F5 does not function as Escape in Vim.
- Control_L functions as a Shift key. cccCCC. But not as a Control modifier key.
- Shift + BackSpace functions as BackSpace.





Now run
xmodmap ~/.xmodmaprc
.


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Control_L (0x25) control Caps_Lock (0x42), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)



Tests:

1) In a text editor: Use Caps_Lock + C to copy some text. Use Caps_Lock + V to paste it.
2) In a text editor: Press Control_L. Type some text. The characters should all be upper case.
3) In
vim
: Enter Insert Mode. Press F5 key to escape Insert Mode and re-enter Command Mode.
4) In a text editor: Type some text. Position the cursor in the middle of the text. Press Shift + Backspace. The character immediately after the cursor should be deleted.


some text. some text. some text. some text. ASDASD ASD ASD.

In Vim, F5 functions as Escape.



some text.somse t.


Test 4 passed.





Good.



Next: Power cycle Shovel.




Shovel turned off and on again.








Tests:

1) In a text editor: Use Caps_Lock + C to copy some text. Use Caps_Lock + V to paste it.
2) In a text editor: Press Control_L. Type some text. The characters should all be upper case.
3) In
vim
: Enter Insert Mode. Press F5 key to escape Insert Mode and re-enter Command Mode.
4) In a text editor: Type some text. Position the cursor in the middle of the text. Press Shift + Backspace. The character immediately after the cursor should be deleted.



copy some text.copy some text.copy some text.copy some text.copy some text.copy some text.copy some text.

Test 1 passed.

ASD ASD ASD ASD

Test 2 passed.

Test 3 passed.

The charaediateuld be deleted.

Test 4 passed.





Excellent.








[a week or so has passed]





Swapping ctrl and caps lock has not been as good an improvement as I had hoped.

Pronation of the wrist has been reduced, true. But the control_l key (caps lock, at the moment) still has to be pressed by the little finger, which is the weakest finger and therefore the least able to handle the mechanical strain.

I have decided that the left Alt key is a better location for the control_l function. This is in the same position as the Command key on a Mac. For most Control + [other key] chord presses with the left hand, the left thumb can be used to press the Alt key, while the index finger presses the [other key]. In some cases, such as Control + C or Control + V, it is easier to use the fourth finger to press the Alt key.

Chord = pressing multiple keys at the same time with the same hand.


So, I'll change the remapping (remember that the remapping occurs on GUI login):
- Caps Lock function will go back to the Caps Lock key.
- Control_L function will move to the Alt_L key.
- Alt function will move to the Control_L key.








Next: Choose final key settings:
- Plan out the changes and commands.
- Plan out the tests for success/failure before executing the changes.
- Change one key at a time, testing as you go.



Changes:
1) Set Alt_L key to perform the Control_L function. Make appropriate adjustment to modifier map for "control" and for "alt".
2) Set Control_L key to perform the Alt_L function. Make appropriate adjustment to modifier map for "control" and for "alt".
3) Set F5 key to perform the Escape function.
4) Set Shift + Backspace key to perform the Delete function (i.e. delete next character).
5) Automate these steps in a script, which is then executed on Gnome GUI login.



Tests:
1) In a text editor: Use Alt_L + C to copy some text. Use Alt_L + V to paste it.
2) In the Gnome GUI: Press Control_L + Tab several times. This should cycle through the running applications.
3) In
vim
: Enter Insert Mode. Press F5 key to escape Insert Mode and re-enter Command Mode.
4) In a text editor: Type some text. Position the cursor in the middle of the text. Press Shift + Backspace. The character immediately after the cursor should be deleted.



Check current keycodes:


[spiano@localhost work]$ xmodmap -pke | grep Control_L

keycode 66 = Control_L NoSymbol Control_L

[spiano@localhost work]$ xmodmap -pke | grep Caps_Lock
keycode 37 = Caps_Lock NoSymbol Caps_Lock


[spiano@localhost ~]$ xmodmap -pke | grep Escape

keycode 9 = Escape NoSymbol Escape
keycode 71 = Escape NoSymbol Escape

[spiano@localhost ~]$ xmodmap -pke | grep BackSpace

keycode 22 = BackSpace Delete BackSpace BackSpace

[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x25) control Control_L (0x42), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)


[spiano@localhost ~]$ xmodmap -pke | grep Alt

keycode 64 = Alt_L Meta_L Alt_L Meta_L
keycode 108 = Alt_R Meta_R ISO_Level3_Shift Multi_key
keycode 204 = NoSymbol Alt_L NoSymbol Alt_L



Keycodes map to these physical keys:
- 71 = F5
- 37 = Control_L
- 66 = Caps_Lock
- 22 = BackSpace
- 64 = Alt_L




Restore original settings.

[spiano@localhost work]$ xmodmap key_settings.txt



Computer input (keyboard, mouse) jammed for about 90 seconds while the command was running. I was playing audio in a web browser at the same time - this might explain the increased delay.






Check current keycodes:


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Control_L (0x25) control Caps_Lock (0x42), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)


[spiano@localhost work]$ xmodmap -pke | grep Control_L

keycode 37 = Control_L NoSymbol Control_L

[spiano@localhost work]$ xmodmap -pke | grep Caps_Lock
keycode 66 = Caps_Lock NoSymbol Caps_Lock


[spiano@localhost ~]$ xmodmap -pke | grep Escape

keycode 9 = Escape NoSymbol Escape

[spiano@localhost ~]$ xmodmap -pke | grep F5

keycode 71 = F5 F5 F5 F5 F5 F5 XF86Switch_VT_5 F5 F5 XF86Switch_VT_5

[spiano@localhost ~]$ xmodmap -pke | grep BackSpace

keycode 22 = BackSpace BackSpace BackSpace BackSpace


[spiano@localhost ~]$ xmodmap -pke | grep Alt

keycode 64 = Alt_L Meta_L Alt_L Meta_L
keycode 108 = Alt_R Meta_R ISO_Level3_Shift Multi_key
keycode 204 = NoSymbol Alt_L NoSymbol Alt_L





Restoring the setting does not restore the modifier map.


To get back to original, need to change Control_L to "control" and Caps_Lock to "lock".




[spiano@localhost work]$ xmodmap -e 'remove Lock = Control_L'


[spiano@localhost work]$ xmodmap -e 'add Control = Control_L'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock control Control_L (0x25), Caps_Lock (0x42), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)


[spiano@localhost work]$ xmodmap -e 'remove Control = Caps_Lock'


[spiano@localhost work]$ xmodmap -e 'add Lock = Caps_Lock'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)





Now everything's back to normal (temporarily - the modification script is still set to run on GUI login).





Let's make the changes.




1) Set Alt_L key to perform the Control_L function. Make appropriate adjustment to modifier map for "control" and for "alt".

Note: When I remove the Alt_L binding for Alt_L, I can still use Alt_R for Alt commands.






[spiano@localhost work]$ xmodmap -e 'remove Mod1 = Alt_L'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)


[spiano@localhost work]$ xmodmap -e 'keycode 64 = Control_L NoSymbol Control_L'


[spiano@localhost work]$ xmodmap -pke | grep Control_L

keycode 37 = Control_L NoSymbol Control_L
keycode 64 = Control_L NoSymbol Control_L

[spiano@localhost work]$ xmodmap -e 'remove Control = Control_L'


[spiano@localhost work]$ xmodmap -e 'add Control = Control_L'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_L (0x40), Control_R (0x69) mod1 Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)




There are now two entries for Control_L in the "control" modifier list. One for each keycode, even though both keycodes have the same keysym.




Test: 1) In a text editor: Use Alt_L + C to copy some text. Use Alt_L + V to paste it.


some text. some text. some text. some text. some text. some text.

works. Alt_L key now functions as Control_L.










Next: 2) Set Control_L key to perform the Alt_L function. Make appropriate adjustment to modifier map for "control" and for "alt".


Note: "alt" in the modifier map is actually "mod1".




[spiano@localhost work]$ xmodmap -e 'remove Control = Control_L'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_R (0x69) mod1 Alt_R (0x6c), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)


[spiano@localhost work]$ xmodmap -e 'keycode 37 = Alt_L Meta_L Alt_L Meta_L'


[spiano@localhost work]$ xmodmap -e 'add Control = Control_L'


[spiano@localhost work]$ xmodmap -e 'add Mod1 = Alt_L'


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x40), Control_R (0x69) mod1 Alt_L (0x25), Alt_R (0x6c), Alt_L (0xcc), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)




Hm. Two entries for Alt_L.


[spiano@localhost work]$ xmodmap -pke | grep Alt_L

keycode 37 = Alt_L Meta_L Alt_L Meta_L
keycode 204 = NoSymbol Alt_L NoSymbol Alt_L





Test: 2) In the Gnome GUI: Press Control_L + Tab several times. This should cycle through the running applications.



Works. Control_L physical key now functions as Alt_L.




Next: 3) Set F5 key to perform the Escape function.

No modifiers are involved.


[spiano@localhost work]$ xmodmap -pke | grep Escape

keycode 9 = Escape NoSymbol Escape

[spiano@localhost work]$ xmodmap -e 'keycode 71 = Escape NoSymbol Escape'


[spiano@localhost work]$ xmodmap -pke | grep Escape

keycode 9 = Escape NoSymbol Escape
keycode 71 = Escape NoSymbol Escape




Test: 3) In
vim
: Enter Insert Mode. Press F5 key to escape Insert Mode and re-enter Command Mode.



Test 3 passed.





Next: 4) Set Shift + Backspace key to perform the Delete function (i.e. delete next character).



I need to set the second keysym in the keysym list for BackSpace to be Delete.


[spiano@localhost work]$ xmodmap -pke | grep BackSpace

keycode 22 = BackSpace BackSpace BackSpace BackSpace

[spiano@localhost work]$ xmodmap -e 'keycode 22 = BackSpace Delete BackSpace BackSpace'


[spiano@localhost work]$ xmodmap -pke | grep BackSpace

keycode 22 = BackSpace Delete BackSpace BackSpace





Test: 4) In a text editor: Type some text. Position the cursor in the middle of the text. Press Shift + Backspace. The character immediately after the cursor should be deleted.



some text. some text. somxt. some text sometme text.


Works. Test 4 passed.







Ok. Success. I'll assemble the command sequence, so that it can be placed in the startup script.





!
! On startup, make alterations to the keyboard layout.
! 1) Set Control_L key ("Control Left") to produce Alt_L effect.
! 2) Set Alt_L key to produce Control_L effect.
! 3) Set F5 key to produce Escape effect.
! 4) Set Shift + BackSpace to produce Delete effect (delete next character).
!
! Remove particular keysyms from the modifier lists.
!
remove Control = Control_L
remove Mod1 = Alt_L
!
! Assign keysym lists to keycodes.
!
keycode 37 = Alt_L Meta_L Alt_L Meta_L
keycode 64 = Control_L NoSymbol Control_L
!
! Add particular keysyms back into the modifier lists.
!
add Control = Control_L
add Mod1 = Alt_L
!
! Assign keysym lists to keycodes.
!
keycode 71 = Escape NoSymbol Escape
keycode 22 = BackSpace Delete BackSpace BackSpace






Put this command sequence into .xmodmaprc.



[spiano@localhost work]$ cat ~/.xmodmaprc

!
! On startup, make alterations to the keyboard layout.
! 1) Set Control_L key ("Control Left") to produce Caps_Lock effect.
! 2) Set Caps_Lock key to produce Control_L effect.
! 3) Set F5 key to produce Escape effect.
! 4) Set Shift + BackSpace to produce Delete effect (delete next character).
!
! Remove particular keysyms from the modifier lists.
!
remove Control = Control_L
remove Lock = Caps_Lock
!
! Assign keysym lists to keycodes.
!
keycode 37 = Caps_Lock NoSymbol Caps_Lock
keycode 66 = Control_L NoSymbol Control_L
!
! Add particular keysyms back into the modifier lists.
!
add Control = Control_L
add Lock = Caps_Lock
!
! Assign keysym lists to keycodes.
!
keycode 71 = Escape NoSymbol Escape
keycode 22 = BackSpace Delete BackSpace BackSpace


[spiano@localhost work]$ vim ~/.xmodmaprc



[spiano@localhost work]$ cat ~/.xmodmaprc

!
! On startup, make alterations to the keyboard layout.
! 1) Set Control_L key ("Control Left") to produce Alt_L effect.
! 2) Set Alt_L key to produce Control_L effect.
! 3) Set F5 key to produce Escape effect.
! 4) Set Shift + BackSpace to produce Delete effect (delete next character).
!
! Remove particular keysyms from the modifier lists.
!
remove Control = Control_L
remove Mod1 = Alt_L
!
! Assign keysym lists to keycodes.
!
keycode 37 = Alt_L Meta_L Alt_L Meta_L
keycode 64 = Control_L NoSymbol Control_L
!
! Add particular keysyms back into the modifier lists.
!
add Control = Control_L
add Mod1 = Alt_L
!
! Assign keysym lists to keycodes.
!
keycode 71 = Escape NoSymbol Escape
keycode 22 = BackSpace Delete BackSpace BackSpace







Perform computer backup again.







Test again before rebooting.



Restore original settings.

[spiano@localhost work]$ ls

key_settings.txt

[spiano@localhost work]$ xmodmap key_settings.txt



The computer ceased to accept keyboard/mouse input for about 30 seconds. I could move the mouse but I couldn't click or select. This time, I didn't have audio playing in a browser.


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Alt_L (0x40), Control_R (0x69) mod1 Control_L (0x25), Alt_R (0x6c), Alt_L (0xcc), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)


The
xmodmap key_settings.txt
command altered the modifier table, although not on purpose, and without any practical effect. It swapped the Alt_L and Control_L keycodes again but kept the same keycodes (rather than the keysyms) in the same positions in the modifier lists.




Compare with the output from a little earlier:


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x40), Control_R (0x69) mod1 Alt_L (0x25), Alt_R (0x6c), Alt_L (0xcc), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)




Tests:
- Control_L + Tab cycles through applications in Gnome GUI.
- F5 does not function as Escape in Vim.
- Alt_L functions as a Control key. Can copy-paste text using Alt+C, Alt+V. asd asd asd
- Shift + BackSpace functions as BackSpace.





Now run
xmodmap ~/.xmodmaprc
to test automation script.






[spiano@localhost work]$ xmodmap ~/.xmodmaprc


[spiano@localhost work]$ xmodmap -pm

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x40), Control_R (0x69) mod1 Alt_L (0x25), Alt_R (0x6c), Alt_L (0xcc), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)






Tests:
1) In a text editor: Use Alt_L + C to copy some text. Use Alt_L + V to paste it.
2) In the Gnome GUI: Press Control_L + Tab several times. This should cycle through the running applications.
3) In
vim
: Enter Insert Mode. Press F5 key to escape Insert Mode and re-enter Command Mode.
4) In a text editor: Type some text. Position the cursor in the middle of the text. Press Shift + Backspace. The character immediately after the cursor should be deleted.


some text. some text. some text. some text.
Test 1 passed.

Control_L + Tab cycles through applications in Gnome GUI.
Test 2 passed.

In Vim, F5 functions as Escape.
Test 3 passed.

some text. some me textmeext.
Test 4 passed.








Good.



Next: Power cycle Shovel.




Shovel turned off and on again.





Tests:
1) In a text editor: Use Alt_L + C to copy some text. Use Alt_L + V to paste it.
2) In the Gnome GUI: Press Control_L + Tab several times. This should cycle through the running applications.
3) In
vim
: Enter Insert Mode. Press F5 key to escape Insert Mode and re-enter Command Mode.
4) In a text editor: Type some text. Position the cursor in the middle of the text. Press Shift + Backspace. The character immediately after the cursor should be deleted.


some text. some text. some text. some text.
Test 1 passed.

Control_L + Tab cycles through applications in Gnome GUI.
Test 2 passed.

In Vim, F5 functions as Escape.
Test 3 passed.

st. some texte textxt.
Test 4 passed.






Excellent.









That's the end of this project.













[start of notes]



Changes from the original text:
- I have not always preserved the format of any excerpts from man pages (e.g. removing extra spaces, line-breaking newlines, word-breaking hyphens).
- I have not always preserved the format of any computer output (e.g. from running bash commands). Examples: Setting input lines in bold text, adding/removing newlines in order to make a sequence of commands easier to read, using hyphens for lists and sublists instead of indentation, breaking wide tables into consecutive sections.


[end of notes]