Skip to content

Instantly share code, notes, and snippets.

@myguidingstar-zz
Last active September 5, 2016 07:42
Show Gist options
  • Save myguidingstar-zz/32d39f2c9c1448ff5b935257a2ea3b2e to your computer and use it in GitHub Desktop.
Save myguidingstar-zz/32d39f2c9c1448ff5b935257a2ea3b2e to your computer and use it in GitHub Desktop.
! ### Development/debug tips
! `xev` and `showkey` to see which keycode is pressed
! find information of old keys
! `xmodmap -pke |grep Something`
! Fastest way to get Unicode number out of Unicode chars
! - in Python repl:
! >>> myChars=u'≈°⋆³≡≠'
! >>> myChars
! u'\u2248\xb0\u22c6\xb3\u2261\u2260'
! - copy the escaped string inside the quotes the above, replace all \x?? with \u00?? then convert to uppercase using Bash
! echo '\u2248\xb0\u22c6\xb3\u2261\u2260' | sed s/\x/\u00/g | tr '[:lower:]' '[:upper:]'
! - the result is ready to copy with one click
! \U2248\U00B0\U22C6\U00B3\U2261\U2260
! ### Configuration
!Double Shift makes Caps_Lock
keycode 50 = Shift_L Caps_Lock Shift_L Caps_Lock
keycode 62 = Shift_R Caps_Lock Shift_R Caps_Lock
! former Tab
! BackSpace and ∅
keycode 23 = BackSpace NoSymbol U2205
! former BackSpace
! Delete and S̶t̶r̶i̶k̶e̶t̶h̶r̶o̶u̶g̶h̶
keycode 22 = Delete NoSymbol U0336
! former Control_L
keycode 37 = Super_L
! former Super_L
keycode 133 = Alt_L
! former Alt_L
keycode 64 = Control_L
! former Alt_R
keycode 108 = Control_R
! former Ctrl_R
keycode 105 = Return
! former Super_R
keycode 134 = Alt_R
! former Menu
keycode 135 = Menu
!! CapsLock is now Mode_switch
!! Enter is Mode_switch, too
!! Double Mode_switch (former CapsLock+former Enter) = Enter
keycode 66 = Mode_switch NoSymbol Return
keycode 36 = Mode_switch NoSymbol Return
! Before assignment the modifier keys need to be empty
clear lock
clear control
clear mod1
clear mod4
clear mod5
add Control = Control_L Control_R
add mod1 = Alt_L Alt_R
add mod4 = Super_L Super_R
add mod5 = Mode_switch ISO_Level3_Shift
! Shift + space = middle dot ·
! Mode_switch + space = Tab
keycode 65 = space U00B7 Tab ISO_Left_Tab
! Mode_switch + Qwerty's I/K/J/L (Dvorak's C/T/H/N) => Up/Left/Down/Right
keycode 31 = c C Up
keycode 45 = t T Down
keycode 44 = h H Left
keycode 46 = n N Right
! Mode_switch + Qwerty's Y/H (Dvorak's F/D) => PageUp/PageDown (aka Prior/Next)
keycode 29 = f F Prior
keycode 43 = d D Next
! Mode_switch + Qwerty's U/O (Dvorak's G/R) => Home/End
keycode 30 = g G Home
keycode 32 = r R End
! ### Unicode symbols ###
! k and ©
keycode 55 = k K U00A9
! w and ❤
keycode 59 = w W U2764
! - and ¬
keycode 48 = minus underscore notsign
! % and °
keycode 10 = ampersand percent degree
! 2 and ²
keycode 17 = parenright 2 U00B2
! 3 and ³
keycode 13 = braceright 3 U00B3
! # and ov̅e̅r̅l̅i̅n̅e̅
keycode 21 = numbersign grave U0305
! m and µ
keycode 58 = m M U00B5
! x and ×
keycode 56 = x X U00D7
! : and ÷
keycode 24 = semicolon colon U00F7
! v and ₫
keycode 60 = v V DongSign
! e and €
keycode 40 = e E EuroSign
! < and ←
keycode 25 = comma less U2190
! > and →
keycode 26 = period greater U2192
! ^ and ↑
keycode 35 = at asciicircum U2191
! | and ↓
keycode 51 = backslash bar U2193
! " and ↔
keycode 52 = apostrophe quotedbl U2194
! b and ∈
keycode 57 = b B U2208
! + and ∑
keycode 18 = plus 4 U2211
! * and ∏
keycode 16 = asterisk 0 U220F
! / and √
keycode 34 = slash question U221A
! i and ∩
keycode 42 = i I U2229
! u and ∪
keycode 41 = u U U222A
! s and ∫
keycode 47 = s S U222B
! ~ and ≈
keycode 49 = dollar asciitilde U2248
! = and ≠
keycode 15 = equal 9 U2260
! 1 and ≡
keycode 14 = parenleft 1 U2261
! P and ⊃
keycode 27 = p P U2283
! Y and ⊂
keycode 28 = y Y U2282
! 5 and ⋆
keycode 12 = braceleft 5 U22C6
! [ and ☐
keycode 11 = bracketleft 7 U2610
! ] and ☑
keycode 19 = bracketright 6 U2611
! q and ☠
keycode 53 = q Q U2620
! j and ♪
keycode 54 = j J U266a
! 8 and ∞
keycode 20 = exclam 8 U221e
! A and Δ
keycode 38 = a A U0394
! O and Ω
keycode 39 = o O U03A9
! l and λ
keycode 33 = l L U03BB
! z and U̲n̲d̲e̲r̲l̲i̲n̲e̲
keycode 61 = z Z U0332
@myguidingstar-zz
Copy link
Author

myguidingstar-zz commented May 6, 2016

Result

(blue keys←Shift, orange & red ones←Modeswitch, non characters are red)

@myguidingstar-zz
Copy link
Author

myguidingstar-zz commented May 20, 2016

Usage:

  • Produce xkb layout from the above (only needed doing once)
    • setxkbmap us -variant dvp
    • xmodmap the-xmodmap-file-above
    • xkbcomp -xkb $DISPLAY xkbmap → will produce a file named xkbmap
  • add to your startup script this command:
    • xkbcomp -w 0 xkbmap $DISPLAY → load the xkbmap file above

@cmpitg
Copy link

cmpitg commented Jun 24, 2016

@myguidingstar: Is it possible to re-map something like mode_switch + gsuper + g?

@cmpitg
Copy link

cmpitg commented Sep 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment