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
  1. $ xev -id `xwininfo | grep 'Window id' | awk '{print $4}'`
  2. EnterNotify event, serial 13, synthetic NO, window 0×6400053,
  3.     root 0x13c, subw 0x640005b, time 42431610, (367,0), root:(369,63),
  4.     mode NotifyNormal, detail NotifyVirtual, same_screen YES,
  5.     focus NO, state 16
  6.  
  7. MotionNotify event, serial 13, synthetic NO, window 0×6400053,
  8.     root 0x13c, subw 0x640005b, time 42431610, (367,0), root:(369,63),
  9.     state 0×10, is_hint 0, same_screen YES
  10.  
  11. MotionNotify event, serial 13, synthetic NO, window 0×6400053,
  12.     root 0x13c, subw 0x640005b, time 42431618, (366,0), root:(368,63),
  13.     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

Tags: , , , , , , , , ,
This post is under “coding, fun, terminal heroes” and has no respond so far.
If you enjoy this article, make sure you subscribe to my RSS Feed.

Post a reply