I am trying to create a cron job that sends a notification via notify-send.
I am currently trying this:
*/2 * * * * DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus /usr/bin/notify-send "test"
which is working if I just run it from a terminal.
I've also tried setting
XAUTHORITY=/home/munhunger/.Xauthority
I have a similar crontab that runs a shell script with the same variables that is printing to a log file, so I know that the crontab is working. But still, no notifications are showing up.
Does anyone have any idea of what might be wrong?
I am running with Ubuntu 17.10 with i3 on top
XDG_SESSION_COOKIE
as well. And check yourDBUS_SESSION_BUS_ADDRESS
for a valid value.DBUS_SESSION_BUS_ADDRESS
seems to be valid... never seen theXDG_SESSION_COOKIE
before. Do you have any suggestion as to what to set it to?DBUS_SESSION_BUS_ADDRESS='unix:abstract=/tmp/dbus-idumFnhFQ6,guid=484c45028754af8abc0cbc995b72642b'
. Are you sure you have more simple value?printenv
myDBUS_SESSION_BUS_ADDRESS
looks like that