Does anyone know a way to make notify-send work from a bash script that's executed by cron or anacron? I spent half the day trying to figure this out and read a lot of not-useful web pages.
Basically, I want a anacron script to do something, then notify the user that it has occurred or if it failed. Maybe there's a better way than notify-send, but I like it's output.
Mostly I've tried:
su $USER -c "notify-send -i <icon> -t 0 '<title>' '<message>'"
and also added DISPLAY=:0 in a couple places. My testing has been to run the script from the command line using "sudo". With the above entry, the script halts at it and does not proceed. Other variations result in error messages.
Basically, I want a anacron script to do something, then notify the user that it has occurred or if it failed. Maybe there's a better way than notify-send, but I like it's output.
Mostly I've tried:
su $USER -c "notify-send -i <icon> -t 0 '<title>' '<message>'"
and also added DISPLAY=:0 in a couple places. My testing has been to run the script from the command line using "sudo". With the above entry, the script halts at it and does not proceed. Other variations result in error messages.
Comment