Hmm, indeed the original intent of that code was to support being run in cron. I'm not sure I love the idea of simply a documentation fix (telling users to manually prefix dbus-run-session).
But maybe one of the other solutions proposed can be a good fix. Or maybe a very user-friendly error message in this case, suggesting dbus-run-session, would be enough...
Hmm, indeed the original intent of that code was to support being run in cron. I'm not sure I love the idea of simply a documentation fix (telling users to manually prefix dbus-run-session).
But maybe one of the other solutions proposed can be a good fix. Or maybe a very user-friendly error message in this case, suggesting dbus-run-session, would be enough...