#!/bin/sh # Remap Maltron keys to better suit programming and other geektivities: # # - the key labeled "[" produces "(" # - the key labeled "]" produces ")" # - the key labeled "(" produces "[" (shift+9) # - the key labeled ")" produces "]" (shift+0) # - the key labeled "*" produces "=" (shift+8) # - the key labeled "=" produces "_" # - the key labeled "+" produces "!" (shift+=) # - the key labeled "-" produces "*" # - the key labeled "_" produces "+" (shift+-) # # As for this next remapping, it's clear that it's needed any longer; # I list it here in case the problem ever recurs, but the key seems to # DTRT these days without my having to do anything special: # # - the key labeled with *just* a minus sign will produce hyphen-minus # (Do search://dash hyphen minus/ for details about that last one.) # # To undo all these remappings, run unmaltron.sh. sudo keyd bind '[ = (' sudo keyd bind '] = )' sudo keyd bind 'shift.[ = {' sudo keyd bind 'shift.] = }' sudo keyd bind '= = _' sudo keyd bind '- = *' sudo keyd bind 'shift.8 = =' sudo keyd bind 'shift.9 = [' sudo keyd bind 'shift.0 = ]' sudo keyd bind 'shift.= = !' sudo keyd bind 'shift.- = +' # You still need this in /etc/keyd/default.conf: # # [ids] # * # # But then the rest of the file can be empty. Here is what it *would* # say to have the equivalent effect to the above 'bind' commands: # # [main] # # [ = ( # ] = ) # = = _ # - = * # # [shift] # 8 = = # 9 = [ # 0 = ] # [ = { # ] = } # = = ! # - = + # Historical note: I used to accomplish all this with xmodmap: # # xmodmap -e "keycode 34 = parenleft braceleft" \ # -e "keycode 35 = parenright braceright" \ # -e "keycode 17 = 8 equal" \ # -e "keycode 18 = 9 bracketleft" \ # -e "keycode 19 = 0 bracketright" \ # -e "keycode 20 = asterisk plus" \ # -e "keycode 21 = underscore exclam" \ # -e "keycode 82 = minus hyphen" # # But the X->Wayland transition brought those days to a close. The # gates drew shut, and the mighty horn of the dwarves rang no more in # these hills.