Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dvorak patches for t430 #177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bwachter
Copy link
Contributor

I recently got my hands on a t430 as well, so, here we go again. I've also added some comments this time why this can have advantages over configuring it on OS level.

@hamishcoleman
Copy link
Owner

Cool! Thanks. Since the first patch, I have made a half-arsed config system, so we can probably make it simpler to enable/disable than editing the Makefile, too!

@bwachter
Copy link
Contributor Author

I noticed something about the config thing, but didn't look into it in more detail.

More useful might be that the each row in the hexdump related to the keyboard mappings is unique in the file (even when looking at the complete image), and the block for the key mapping is the same (just on different locations) for each of the models, so complex changes like this could be moved to just a sed over a temporarily exported hexdump.

So instead of messing with a hex editor this time I took my notes from last time, and just did (after applying the inital patches, of course):

IMG=t430.G1HT35WW.img
hexdump -C $IMG > .prepatched.hex
xxd $IMG > hex_to_patch
sed -i -e 's/0102 1110 1f6e 2e83/0102 2910 1f6e 2883/' \
       -e 's/7003 121e 202d 2f00/7003 351e 192d 1100/' \
       -e 's/7104 1372 2173 3000/7104 3672 1373 2500/' \
       -e 's/0605 1415 2223 3132/0605 1a16 1718 262f/' \
       -e 's/0708 1716 2524 3433/0708 2322 2421 3432/' \
       -e 's/0d09 181c 2675 3538/1c09 300d 1575 1238/' \
       -e 's/770a 1976 2784 3685/770a 1476 3384 3185/' \
       -e 's/0c0b 1a1b 2829 2a37/1b0b 2737 200c 2a2e/'
xxd -r < hex_to_patch | hexdump -C > .dvorak.hex
diff -Nu .prepatched.hex .dvorak.hex > 007_dvorak.patch

That should work as build step for any image, without the need of patches (and of course similar with the ctrl-caps swap). I didn't verify if there are duplicate sequences in the unpatched image, but even if there are, when taking a bit of context into account I'm sure it is unique. So for when I'm (or somebody else is) properly bored it might make sense to rewrite the patch script to parse hexdumps by itself and have it do search/replace based on a configuration table which is no longer (fully) model specific. That'd then also allow to just parse console or X keymaps and easily transform them to flashable keyboard layouts.

(Another reason for "why it makes sense to flash it" is that you can answer "can you change the layout to something I can type on" truthfully with "I don't have layouts installed making it any better for you", keeping people away from your computer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants