Closed SevenOutman closed 6 years ago
Could it be a problem with the user being used to execute the commands from crontab?
@fa7ad Not really. I run crontab as the same user with that when I run my script manually. By the way, if set
method fails on user permission, I think its Promise should have been rejected.
FWIW, can you try running the script through a nodejs script?
setInterval(() => {
wallpaper.set(...)
}, 60000)
and keeping that running (like a daemon)
@fa7ad Thanks, your approach may work. However, it's not actually my final goal to change wallpaper at an interval. I was trying to run my script upon system wakeup (Ubuntu has hooks for that), but it didn't work. So I tried running my script with crontab, but it didn't work as well. I guess these 2 scenarios have a same cause, so I only mentioned the crontab scenario in this issue for easier understanding.
@SevenOutman If your goal is to run at startup, try creating a .desktop file at ~/.config/autostrart
or using a systemd service (just set the user and group options)
@fa7ad Thanks for your advice. But I want to run my script at wakeup, not startup.
@SevenOutman sorry, missed that. well, good luck
My script looks like this:
which is run by
crontab
on Ubuntu 16.04 (with GNOME). The wallpaper doesn't change, and the loggedimagePath
does not equalfullImagePath
. The output was like:However when I run this script manually (not invoke by crontab), it works fine.