I need to run some program within crontab , but how can the program know about dbus session id ? it's only available for programs launched by session managers.
Dbus stores the session address in a file in
Beware that there's no guarantee that the dbus daemon is still available. The user may have logged out.
An alternative method is to find the PID of a process in the desktop session, and obtain the dbus address from its environment.
If the crontab is running as root and you want to communicate with the session of whatever user is logged in on the console, see Can I launch a graphical program on another user's desktop as root?
I think if you know the pid of the gnome session manager, then you read the environment from
Use the SESSION id then, with other programs like notify-send or dbus* tools.