I've added the (f)cronjob
*/1 * * * * DISPLAY=:0 notify-send testing
to display a notification every minute, but it doesn't work; why not? (Using i3.)
It doesn't work as a cronjob because crontab runs in background. You need to set the variable for it, like this:
*/1 * * * * <user> export DISPLAY=:0 && notify-send 'testing'
export DISPLAY=:0
in your crontab entry (of course assuming DISPLAY:=0
is the correct display, but you pointed that out in a comment to your question).
– 13dimitar
Feb 28 '17 at 12:34
export
which it seems makes the var available to sub-processes, but that doesn't seem to be the crucial thing here.
– Toothrot
Feb 28 '17 at 12:36
export DISPLAY=:0
to my cron file actually helped with Error: GDK_BACKEND does not match available displays, thanks!
– ᴍᴇʜᴏᴠ
Aug 24 '18 at 20:17
$DISPLAY
could be:0.0
. – Ken Sharp Feb 28 '17 at 12:22man xauth
, and find out how your desktop system/display manager generates MIT cookies (Gnome does some icky things IIRC).ps axu | grep X
looking at-auth
in the commandline if present may be helpful. – dirkt Feb 28 '17 at 13:08DBUS_SESSION_BUS_ADDRESS=<...>
at the top of my cron file. Works after reboot too on my system. – Toothrot Feb 28 '17 at 15:43