Cron with notify-send

前端 未结 13 1218
我寻月下人不归
我寻月下人不归 2020-12-09 10:06

I need to show a notification from a cron job. My crontab is something like:

$ crontab -l
# m h  dom mon dow   command
  * *   *   *   *    Display=:0.0 /usr         


        
相关标签:
13条回答
  • 2020-12-09 10:35

    Only this works for me (Xubuntu)

    eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME xfce4-session)/environ)"; notify-send  "hello world" 
    

    If you are in gnome enviroment, you need change xfce4-session to gnome-session

    refer: https://askubuntu.com/questions/298608/notify-send-doesnt-work-from-crontab

    0 讨论(0)
提交回复
热议问题