On 3/1/23 4:35 PM, Marvin Jones via tde-users wrote:
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.
As was mentioned, passing "notify" to a search engine --
even with other search terms -- is of little use.
Hi Jonesy,
All I have used through the past many years is the notify-send command
that is part of the libnotify package.
All I do is write shell scripts or one-liners for cron. Because cron
never has a full environment, the DISPLAY environment variable needs to
be defined for notify-send to function outside the environment.
To get an idea how this functions, ensure the libnotify package is
installed. Send the following command:
notify-send --expire-time=5000 "Test" "This is a message test."
The message popup will remain open for 5 seconds.
The kdbusnotification package is broken, but any notification daemon
from other desktop environments will suffice.
In your use case, at the end of the long running script add something
like this:
if [ "$DISPLAY" = "" ]; then
DISPLAY=:0
fi
DISPLAY=$DISPLAY notify-send --expire-time=$TIMEOUT "$SUBJECT" "$MSG"
I hope that helps.
DA