Cron with notify-send

前端 未结 13 1257
我寻月下人不归
我寻月下人不归 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:22

    I use i3 on Ubuntu 18.04. My way to solve this is:

    * * * * * XDG_RUNTIME_DIR=/run/user/$(id -u) notify-send Hey "this is dog!"

    Edit 2020: I still use it on Ubuntu 20.04.

提交回复
热议问题