You are not logged in.
Pages: 1
I created a cronjob using the crontab -e command
00 * * * * xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorLVDS1/workspace0/last-image -s /home/Aryan/MyDrive/Stuff/Wallpapers/xfce-dynamic-wallpaper/src/backgrounds/$(date +%H).jpg.
This command checks the hour and sets the wallpaper accordingly from a folder with 24 pictures(named as 00 to 23).The command runs perfectly fine in a terminal window but not as a cron job.
Also the cron package works fine as i have done many cron jobs.
(I run MX linux 19.4 with kernal version 4.19.0-16-amd64 if it helps)
Last edited by Akadole1932 (2021-06-17 03:53:46)
Offline
Hi there! The problem is that the % sign in crontab is treated as new line separator.
Here's the explanation from the crontab manual page:
Percent-signs (%) in the command, unless escaped with backslash (\), will be changed into newline characters, and all data after the first % will be sent to the command as standard input. There is no way to split a single command line onto multiple lines, like the shell's trailing "\".
So the working version of your command would look like this:
00 * * * * xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorLVDS1/workspace0/last-image -s /home/Aryan/MyDrive/Stuff/Wallpapers/xfce-dynamic-wallpaper/src/backgrounds/$(date +\%H).jpg
Sources used:
https://serverfault.com/questions/27447 … ns-in-cron
Offline
Thanks for the advice It's working now!!! .
I did that still it didn't work so i redirected the output to a text file and this was the output - Failed to init libxfconf: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 (previously i had not output). So i did a quick search and got an answer https://askubuntu.com/a/805797 here.And it works!
Thanks for the answer, now I have a different wallpaper based on the time of day <3
Last edited by Akadole1932 (2021-06-17 11:32:29)
Offline
Pages: 1
[ Generated in 0.013 seconds, 9 queries executed - Memory usage: 522.79 KiB (Peak: 523.63 KiB) ]