I want to interact with the GUI of my display(Open an image every time I press a button that I have interfaced via GPIO) via a python script which is executed after bootup. (I have edited crontab file to execute a shell script which in turn executes the python file).
However, the image does not open. Python logs say: "Error: no "view" rule for type "image/png" passed its test case"
Note: The program works perfectly fine when I execute the shell file manually. The problem occurs only when the script is executed via crontab
What can be the possible cause for this?
export DISPLAY=0:0
(or something similar) in your shell script - to point to the GUI. Better would be to start your Python script from the GUI - there may be a way to do this automatically at log-on time. If you want further help, include details of your OS and desktop manager.:0.0
. See askubuntu.com/a/432257 for details .