I use xev to debug x11 events for a window. I can filter events using grep, for example: xev -id windowid | grep FocusIn
. I want to append time to each output from the above command (date +"%T.%N")
. I need to know when each event occured. Is it possible ? How to achieve that ?
Edit1
Following command works:
xev -id windowid | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'
but with grep there is no output:
xev -id windowid | grep FocusIn | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'
When I use grep and ts there is also no output:
xev -id windowid | grep FocusIn | ts
How to fix that ?