Closed cjwelborn closed 7 years ago
The owner of pyxhook accepted my changes for pyxhook.py
, so if you don't like the keylogger.py
changes you could just update from there.
Also, please squash your commits into one. 😉
Thanks!
@GiacomoLaw, readme updated, commits squashed. :smile:
This PR allows the linux version of KeyLogger to run on Python 2 or 3. The code was reformatted in Pep8 style to help with readability. Three environment variables are checked so options can be set:
pylogger_file
: Sets the file path for the logger. Defaults to:~/Desktop/file.log
pylogger_cancel
: Sets the cancel key for the logger. Defaults to: `pylogger_clean
: Determines whether the log file should be cleared at the start. Defaults to:No
(not set
)Example usage of environment variables:
If
keylogger.py
is made executable (chmod +x keylogger.py
), you can drop thepython3
part:By prepending the environment variables to the command, it sets the variable for that command's subshell only. They can be set permanently by putting them in
.bashrc
.These options could just as well be implemented using command-line options, but I thought the argument parsing might add too much code (even though docopt only takes one line after you define the usage string).