On Wednesday 01 March 2023 04:35:11 pm Marvin Jones via tde-users wrote: > The recent notify issue discussion prompts me to ask: > > Is there a notify HOWTO anywhere for me to learn about > how to implement notify? > > I have a few long-running, in the background bash scripts > where notify would be a nice touch to implement. Hi Jonesy, There's probably a few dozen ways to do a notification. You saw Darrell’s in the prior thread. This is how I’ve done it from cron for a long time. I won’t say it’s pretty, it’s just the first thing I got working ;) # # # In attachment # # # HTH, Michael PS: I believe zenity worked a long time ago and I just replaced it with yad after it broke?
#!/bin/bash ### These are in include files named "$IncStdFuncs" function NotifyBadNews { export DISPLAY=:0 CurrDateTime=$(date +"%y-%m-%d %H:%M:%S") # zenity --error --text="An error occurred in $ME\!\n\nNextline\n\nNextline2" --title="$CurrDateTime: Warning\!" & yad --on-top --center --width=600 --height=600 --image "dialog-error" --text="An Error occurred in '$ME' \!\n\n$1\n\n$2\n\n$3" --title="Warning! - $CurrDateTime" & } if [[ $0 == /* ]] ; then ME=`basename $0` else ME='bash' fi ### This is in the running script . "$IncStdFuncs" NotifyBadNewsWhat01='Run as Root' NotifyBadNewsWhat02='Attempted to run as Root! This script must not be run as root!' NotifyBadNews "$NotifyBadNewsWhat01" "$NotifyBadNewsWhat02" exit 1 ###
____________________________________________________ tde-users mailing list -- users@xxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxx Web mail archive available at https://mail.trinitydesktop.org/mailman3/hyperkitty/list/users@xxxxxxxxxxxxxxxxxx