Terminal Heroes – 6 – Track X events
Posted by Ktoso on 20/09/2009 – 00:53
Another Command Line Fu oneliner I’ve sumbited today:
#show X window events in chosen window
-
$ xev -id `xwininfo | grep 'Window id' | awk '{print $4}'`
-
EnterNotify event, serial 13, synthetic NO, window 0×6400053,
-
root 0x13c, subw 0x640005b, time 42431610, (367,0), root:(369,63),
-
mode NotifyNormal, detail NotifyVirtual, same_screen YES,
-
focus NO, state 16
-
-
MotionNotify event, serial 13, synthetic NO, window 0×6400053,
-
root 0x13c, subw 0x640005b, time 42431610, (367,0), root:(369,63),
-
state 0×10, is_hint 0, same_screen YES
-
-
MotionNotify event, serial 13, synthetic NO, window 0×6400053,
-
root 0x13c, subw 0x640005b, time 42431618, (366,0), root:(368,63),
-
state 0×10, is_hint 0, same_screen YES
After executing this, click on a window you want to track X Window events in. You could “read” this command like this: “xev will track events in the window with the following -id, which we get by greping window information obtained by xwininfo” :-)
Ok, but why did I need such weird information? Well, I wanted to make a simple video showing vis, a vim plugin etc. But as it is always in vim, keypresses are essential – so I wanted to “show what i type” bigger :-) I’ll post it really soon btw… :-)
The command was posted on commandlinefu


Post a reply