Cron not able to succesfully change background
Posted
by
Solenoid
on Ask Ubuntu
See other posts from Ask Ubuntu
or by Solenoid
Published on 2012-05-21T16:35:17Z
Indexed on
2012/09/28
3:49 UTC
Read the original article
Hit count: 382
I'm running 12.04 with a custom XML background (modification on Day of Ubuntu) that changes based on time of day. I've noticed that there's a significant delay between when the changes are scheduled to take place in the XML file and when they actually show up on the background. I've also noticed that when I resume from suspend I don't get the correct background image either. I've found that cycling the wallpaper manually will fix this, and I've written a script to automate the process. If I execute the script manually it works fine. However, when I schedule the script to run in cron, cron doesn't change the background. To make sure that the script was being run properly by cron, I had it create a directory in my home folder after running the background change, and the directory is created successfully, so I know cron is running and executing the script.
My script:
#!/bin/bash
sleep 5
gsettings set org.gnome.desktop.background picture-uri
file:///home/zak/Pictures/Wallpaper/DOU2.xml
sleep 1
gsettings set org.gnome.desktop.background picture-uri
file:///home/zak/Pictures/Wallpaper/DOU.xml
sleep 1
mkdir /home/zak/iscronworking
exit
Is cron just not able to access gsettings? The job is on my user crontab so it shouldn't be running as root.
Alternately, is there any way to make Precise play nicely with XML wallpaper?
© Ask Ubuntu or respective owner