Re: notify

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
____________________________________________________
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



[Index of Archives]     [Trinity Devel]     [KDE]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux