Discussion:
Using notify-send for notifications from cron-run scripts
(too old to reply)
twilight
2016-07-22 19:41:22 UTC
Permalink
Hello guys!

I'm trying to do some automation on my machine and I would like to have
freebsd-update and portsnap ran weekly. I want to send a notification to
my X session after completing the update fetch, that new updates are
available (updating automatically would not be desired as a good case
due to uncontrollable results).

But I've came across a problem: fetching fresh ports and freebsd updates
requires the scripts to be ran from root, but in root session I'm unable
to notify-send anything to my display.

I've tried to set `export DISPLAY=:0`, but that didn't work out.
Also I've tried to use `env DISPLAY=:0 su twilight -c 'notify-send
"...."'` but that didn't work out either.
Searching the net also lead me up to the same advances.

What am I doing wrong? I'd be very thankful for any advice
--
Cheers~

PGP key fingerprint:
07B3 2177 3E27 BF41 DC65 CC95 BDA8 88F1 E9F9 CEEF

You can retrieve my public key at pgp.mit.edu.
The Lost Admin
2016-07-28 15:16:21 UTC
Permalink
Twilight,

You probably need use xauth to export the X11 authentication cookie from your user account to the root account.


The Lost Admin
Post by twilight
Hello guys!
I'm trying to do some automation on my machine and I would like to have
freebsd-update and portsnap ran weekly. I want to send a notification to
my X session after completing the update fetch, that new updates are
available (updating automatically would not be desired as a good case
due to uncontrollable results).
But I've came across a problem: fetching fresh ports and freebsd updates
requires the scripts to be ran from root, but in root session I'm unable
to notify-send anything to my display.
I've tried to set `export DISPLAY=:0`, but that didn't work out.
Also I've tried to use `env DISPLAY=:0 su twilight -c 'notify-send
"...."'` but that didn't work out either.
Searching the net also lead me up to the same advances.
What am I doing wrong? I'd be very thankful for any advice
--
Cheers~
07B3 2177 3E27 BF41 DC65 CC95 BDA8 88F1 E9F9 CEEF
You can retrieve my public key at pgp.mit.edu.
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
Loading...