description "Unity GTK Module Environment variables"

start on starting dbus

pre-start script
    for DESKTOP in $(echo "$XDG_CURRENT_DESKTOP" | sed 's/:/ /g')
    do
      if [ "x$DESKTOP" = "xUnity" ]; then
        exit 0
      fi
    done
    stop
end script

script
    if [ -n "$GTK_MODULES" ]
    then
      GTK_MODULES="$GTK_MODULES:unity-gtk-module"
    else
      GTK_MODULES="unity-gtk-module"
    fi

    initctl set-env --global GTK_MODULES=$GTK_MODULES
end script
