pyxhook.py – Simple Python Keylogger, that works on Linux It is 100% desktop and GUI toolkit independent.

pyxhook is an implementation of pyhook (http://sourceforge.net/projects/pyhook/ [Python wrapper for global input hooks in Windows. The package provides callbacks for mouse and keyboard events; events can be monitored and filtered.]) that works on Linux It is 100% desktop and GUI toolkit independent. It is taken from: http://sourceforge.net/projects/pykeylogger/ The purpose of this repository is to provide a central location for obtaining just pyxhook.py library and provide a clear example of its usage (pyxhook.git).
requires:
– at least python-xlib 1.4
– xwindows must have the “record” extension present, and active.
Dependencies: xlib (sudo apt-get install python-xlib)
main.py Script:

 
Fix pyxhook.py Script :

 

Source: https://github.com/rafaeldefazio