title: Unable to change wallpaper using cronjob on ubuntu
body: <p>My script - </p>
  
  <pre><code>#!/bin/sh
  
  # export DBUS_SESSION_BUS_ADDRESS environment variable
  PID=$(pgrep gnome-session)
  export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
  
  DIR="/home/umang/Downloads/Wallpapers"
  PIC=$(ls $DIR/*.jpg | shuf -n1)
  /usr/bin/gsettings set org.gnome.desktop.background picture-uri file://$PIC
  </code></pre>
  
  <p>cronjob file -</p>
  
  <pre><code>* * * * * /path/to/script/Wallpaper_Changer.sh
  * * * * * date &gt;&gt; /path/to/logfile/CronTest.log
  </code></pre>
  
  <p>Wallpaper changes correctly via terminal and the dates are logged via cron.</p>
  
  <p>I am running ubuntu 14.04, GNOME Shell 3.12.1.
  Help me change wallpaper on gnome as well as unity.</p>