I have tried several approaches to fixing this issue, but all I want to do is change the desktop wallpaper when this script is run in cron. Below is what I have so far.
PID=$(pgrep gnome-session)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
sudo gsettings set org.gnome.desktop.background picture-uri file:///home/mark/Pictures/Background_Pictures/CAP.jpg
I get the following error when I run this in cron.
(process:17154): dconf-WARNING **: failed to commit changes to dconf: Cannot autolaunch D-Bus without X11 $DISPLAY
I know that part of the problem is that I need to set the DBUS_SESSION_BUS_ADDRESS
variable, but I have and it seems to have a valid value.
I'm at a loss as how to accomplish this. Does anyone have a valid solution for this?
cron
to set your desktop wallpaper?System Settings
->Appearance
it can cycle through wallpaper I believe.sudo
? and b) you might needdbus-launch