Hack Jam Log Book is a log of progress made in and around a weekly hack session. Topics include natural language processing, high energy electronics, linguistics, interface design, &c. Enjoy.

Recent Posts:

Archives:

9.8.09

 

xkb and xmodmap: a big mess

So I've convinced myself to try a new keyboard mapping; arensito is currently the only word that I can type quickly and accurately.

I thought that I would take a moment to write down the steps that it took to get a mapping with an extensive and unusual Alt-gr map up and running (on Linux). What is available online is exceedingly unhelpfull.

1. I used Mod_switch rather than ISO_level3_Shift. ISO is the 'correct' choice, but by default N and J cannot be level shifted; fixing that requires xkb, and xkb is evilly difficult to use.

2. Speaking of xkb and evil, Mod_switch won't always work unless xkb is off. So in xorg.conf:

Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbDisable" "true"
# Option "XkbRules" "xorg"
# Option "XkbModel" "latitude"
# Option "XkbLayout" "us"
EndSection

Make sure to comment out all the xkb rules. In .xsession or .xinitrc or wherever you put scripts that run before your X session starts:

export XKB_DISABLE=1

3. Edit .Xmodmap:

keycode 44 = j J plus
keycode 0x41 = Mode_switch
clear mod3
add mod3 = Mode_switch

(note that I use the spacebar as my Mode_switch; chances are you want someting different)

Mode_switch uses the third and fourth keysyms; 'j' and 'J' are the first and second, 'plus' is the third. space+j will return '+'.

Please understand that this is the wrong way to do this; the 'right' way is to use xkb. However, rolling your own xkb mapping is a major undertaking, while xmodmap is reasonably simple. Disabling xkb as I have done here is not reccomended generally, and can apparently cause problems if you use compositing. Nevertheless, this solution works for me.

Labels:


8.8.09

 

a lisp

I'm working on designing a programming language. I am doing so because I want to do more of what I enjoy about programming. Boilerplate code does nothing for me. It is the beautiful code, the obvious-once-you-see-it-but-what-were-you-smoking-when-you-saw-it code, that makes me enjoy programming. I want a language that maximizes my experience of the numinous, a language that comes as close to the platonic program in my head as it can.

I don't want a super-efficient language, or a minimal language, or a super-readable language. I want a language that is fun.

The most controversial way I can put it is probably also the best: there is a quote.

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." – Brian W. Kernighan

My design philosophy is this: I want a language in which I can code as cleverly as possible. Because I enjoy it. To hell with anything else.

Labels:


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]