Closed amitsou closed 3 years ago
Thank you for your very detailed bug report.
Since you are trying to run pynput using crontab
, I assume you are using one of the Linux backends. Please consult the documentation for suggestions on what might be the problem. I will close this issue, as I presume you will find the solution there, but please reopen if that is not the case.
Is this fixed? How'd you get it to run again? It doesn't work for me still and nothing types when I'm using pyinput.keyboard.
As far I'm concerned, pynput is not compatible with cron, so If you need to execute a script a certain amount of time, or certain times just try another solution. For example, a possible solution, would be to use a while loop
The problem with using ptnput from cron
is that unless you run as root and use the uinput backend, you will need a graphical X session, including all required environment variables, and that will not be provided by cron
.
A possible solution is to use a systemd user timer instead, as that will run inside your session and provide the expected environment.
I need to execute a python pynput script using crontab. If I simply run the script from terminal it works just fine, but using cron It can't be executed.
Here's what I'm trying to do in the crontab file:
Here's my code so far:
In addition here's my functions file: