This https://wiki.archlinux.org/title/Cron#Running_X.org_server-based_applications says that,
to have notifications from a cronjob, you have to specify `DBUS_SESSION_BUS_ADDRESS` and `DISPLAY` variables.
The `DISPLAY` variable is easy, it is allways ':0'
But the problem is `DBUS_SESSION_BUS_ADDRESS`. Doing this in a terminal:
$ echo $DBUS_SESSION_BUS_ADDRESS
unix:abstract=/tmp/dbus-TmOWK21wNR,guid=1770ea5d0622fa8ebc76a544612cc0ad
the variable is different every login, so i cant specify it in the crontab.
Now, https://wiki.archlinux.org/title/Cron#Running_X.org_server-based_applications says that dbus var should be like this:
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u $USER)/bus
but in Artix it will be this:
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u $USER)/bus-1
but this doesnt work, because it is not true, because like i said doing this in a terminal:
$ echo $DBUS_SESSION_BUS_ADDRESS
unix:abstract=/tmp/dbus-TmOWK21wNR,guid=1770ea5d0622fa8ebc76a544612cc0ad
tells you the real value.
so to have it always the same, i wrote this in my zprofile:
export DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1000/bus-1'
But, that breaks dunst = doesn't run
# Temporary fix:
writing this in my `zprofie`:
export DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-TmOWK21wNR,guid=1770ea5d0622fa8ebc76a544612cc0ad"
and then having this in my crontab
* * * * * export DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-TmOWK21wNR,guid=1770ea5d0622fa8ebc76a544612cc0ad"; export DISPLAY=':0'; notify-send "beep bop"
...then it works, BUT like i said earlier, every login the dbus variable will change, so the crontab will not have the real vaule.
and just donig only this:
* * * * * export DISPLAY=':0'; notify-send "beep bop"
does not work.