i wrote a shell-skript which should send me a message using libnotify at a specified time. the command that schedules the notification looks like that:
echo "$TAN/reminder.sh execute \"$@\"" | nohup nice -n 9 at $time $date
An example-call in a terminal would be "tan reminder tomorrow 13:00 Don't forget to eat"
$TAN is just an environment variable that stores the path to all of my scripts. At the specified time the following commands are executed:
/usr/bin/notify-send --expire-time=3600000 --urgency=critical --icon=$dialog_png 'Reminder:' "$(date +%T) $@"
/usr/bin/canberra-gtk-play --id="complete" --loop=3 --display=:0.0 --volume=-15 &
Everything works fine as long as there is no reboot in between the scheduling and the execution. After a reboot i only hear the system sound, the desktop notification is omitted.
sends me the following message per mail:
Originally Posted by libnotify per mail
libnotify-Message: Unable to get session bus: Failed to connect to socket /tmp/dbus-hmxHDz4Tki: Connection refused
I found out that at
stores all enviroment variables at the time of execution. I guess this also includes the session-ID...:
Originally Posted by at manpage
The working directory, the environment (except for the variables BASH_VERSINFO, DISPLAY, EUID, GROUPS, SHELLOPTS, TERM, UID, and _) and the umask are retained from the time of invocation.
How could I solve that?