linux:notify_send_cron
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
blog:linux:notify-send-cron [30.09.2010 16:48] – eanderalx | linux:notify_send_cron [23.03.2013 18:39] (current) – Page moved from blog:linux:notify_send_cron to linux:notify_send_cron eanderalx | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== notify-send from cron ====== | ||
+ | **tested with Arch x64 and Gnome 2.3 ** | ||
+ | |||
+ | * If you send an notfiy-send from a cron and use gnome then you normally get an error message. | ||
+ | |||
+ | ~~READMORE~~ | ||
+ | < | ||
+ | libnotify-Message: | ||
+ | </ | ||
+ | * The right User Environment is missing in crontab. | ||
+ | |||
+ | ===== Solution ===== | ||
+ | |||
+ | * You have to save your dbus-session ID and have to know the screen to which the message is send. | ||
+ | * e.g.: | ||
+ | < | ||
+ | echo `set | grep DBUS_SESSION_BUS_ADDRESS | cut -d " | ||
+ | </ | ||
+ | * or (only with root privileges): | ||
+ | < | ||
+ | sudo grep -z DBUS_SESSION_BUS_ADDRESS / | ||
+ | CONTENT=`cat / | ||
+ | echo $CONTENT > / | ||
+ | </ | ||
+ | * Now you can give this informations to notify-send and send the message to the correct user environment | ||
+ | * e.g.: | ||
+ | < | ||
+ | sudo -u username DISPLAY=: | ||
+ | </ | ||
+ | * With "sudo -u" you can send the message from root crontab to a special user else it will send to the owner of the crontab. |
linux/notify_send_cron.txt · Last modified: 23.03.2013 18:39 by eanderalx