Closed jenroper closed 7 years ago
There is a similar issue #3 The problem is (i guess) that cron jobs are not user jobs and do not run "inside" your DE. This is all speculation. I personally do not use cron jobs and have no experience with them. But they are not spawned by the DE so it gets hard for the script to find your running DE.
Maybe you can add a parameter to the script to set the DE manually?
I got it figured out. You need to set the environment variables that the script is looking for along with the DISPLAY environment variable. For example:
export DISPLAY=:0 && export GNOME_DESKTOP_SESSION_ID=this-is-depricated
I updated the readme file on my fork to have better instructions for using this script as a cron job.
It appears that when running this script as a cron job, the code falls through all of the desktop environment checks. The image is downloaded from reddit, but it never gets set as a wallpaper. Here's what I captured in my log.
Traceback (most recent call last): File "./change_wallpaper_reddit.py", line 205, in
desktop_environment = detect_desktop_environment()
File "./change_wallpaper_reddit.py", line 148, in detect_desktop_environment
info = subprocess.getoutput("xprop -root _DT_SAVE_MODE")
AttributeError: 'module' object has no attribute 'getoutput'