=== removed file 'kweasy.awk' --- kweasy.awk 2016-04-13 23:01:49 +0000 +++ kweasy.awk 1970-01-01 00:00:00 +0000 @@ -1,57 +0,0 @@ -#!/bin/awk -f -{ - lines[NR]=$0 - off=0 - line=$0 - while(match(line, FIND)){ - line=substr(line, RSTART+RLENGTH) - off+=RSTART+RLENGTH-1 - matches[NR]=matches[NR] ? matches[NR] SUBSEP off : off - } -} - -END{ - charlen=split("asdfghjkl;qwertyuiopzxcvbnm,.1234567890ASDFGHJKL:QWERTYUIOPZXCVBNM<>!@#$%^&*()", chars, "") - charn=1 - - for(l=NR;l>0;l--){ - if(l in matches){ - delete a - split(matches[l], a, SUBSEP) - for(n in a){ - keys[chars[charn]] = l SUBSEP a[n] - access[l, n] = chars[charn] - if(++charn > charlen) { - break - } - } - } - } - for(l=1;l<=NR;l++){ - # printf "\n%s:", l - print "" - if(!(l in matches)) { - continue - } - delete a - split(matches[l], a, SUBSEP) - off_pre=0 - for(n in a){ - off=a[n] - while(off_pre/dev/null" | getline input - if(input in keys) { - split(keys[input], i, SUBSEP) - printf "%s+%s:%s\n", i[1], i[2], lines[i[1]] - printf "%s", lines[i[1]] | "plumb -a click=" i[2] " -i" - } else { - printf "\nUnhandled input '%s'\n", input - } -}