Many Unix programmers will be familiar with the utility variously called strace
, truss
, ktrace
, dtrace
and probably other names too, which logs all communication between a process and the kernel across the system call interface.
A couple of years ago I wrote an analogous program called xtruss
, which produces similar logging but operates at the interface between an X11 client program and the X server. (Of course, that wasn't a new idea; I just liked my version's design better than prior ones, mostly because it behaves more like strace
.)
A related piece of software to strace
is Subterfugue, which intercepts system calls using the same underlying technology that strace
does, but instead of passively monitoring them, is able to modify the results as it sees fit. The result is a user-
Today I had the idea: why not fill in the blank in that table, and write the thing that is to xtruss
what Subterfugue is to strace
? Reuse xtruss
's framework for conveniently setting up one-
But that wasn't the idea I started off with. I was actually wondering about a much more specific problem: remapping –
And since I already have the X proxy framework from xtruss
, the thought occurred that I could enhance it just a little to let it rewrite or squash X events, and then I'd have a proxy that would do the thing I wanted; and although this would certainly be a disproportionate effort for the result if I were writing that X proxy from scratch, doing it by slightly modifying code I've already got seemed almost practical by comparison.
But of course once I'd thought of doing this job by proxying an X connection and rewriting pieces of it, I realised that that certainly wouldn't be the only use for such technology, which led immediately to the idea of a Subterfugue-
And on the one hand that does sound like quite a fun piece of software … and yet, we're now back to it being a huge amount of work to go to for the sake of the one specific application I actually wanted it for, and I'm pretty sure I can't be bothered. But on the other hand, now I've imagined the generic version, I also wouldn't feel right about writing just the one-
(There seems a good chance that at least one reader will point out some totally different way in which I could impose keystroke-