Cron with notify-send

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

    I found the answer:

    $ crontab -l
    # m h  dom mon dow   command
      * *   *   *   *    export DISPLAY=:0.0 && export XAUTHORITY=/home/ravi/.Xauthority && sudo -u ravi /usr/bin/notify-send Hey "How are you"
    

提交回复
热议问题