On 02/05/2017 01:38 PM, Michael Hamilton wrote:
I was looking for an answer to this quite recently, but found nothing inspiring, your question prompted me to revisit the issue.
There is an old question at stackexchange that addresses this issue:
http://unix.stackexchange.com/questions/2881/show-a-notification-across-all-...
None of the answers are truly satisfactory as there seems to be no universally correct, simple, standard, guaranteed equivalent to tty wall for X11. However, I did manage to get a modified solution to one of the suggestions to work on my system when run as root:
--- snip --- #!/bin/bash PATH=/usr/bin
XUSERS=($(who|egrep "\(:[0-9](\.[0-9])*\)"|awk '{print $1$NF}'|sort -u)) for XUSER in $XUSERS; do NAME=(${XUSER/(/ }) DISPLAY=${NAME[1]/)/} sudo -u ${NAME[0]} DISPLAY=${DISPLAY} \ notify-send "$@" done --- snip ---
If saved in notify-send-all, you can then do:
notify-send-all -i 'dialog-information' Warning 'Shutting down shortly.'
I haven't tested this with more than one display running and I haven't tested on anything other than KDE.
It does raise a question in my mind: if there is something bad in the logs, such as smartd deciding a disk is failing, will the GUI user be informed? Anyone know how this is handled in OpenSUSE?
Cheers, Michael
Thanks, Michael, I will test it out, but I am not sure what to expect. I have tested with notify-send, xmessage, Wall, and at the time I am writing this I do not know what others I have tried before I wrote the original posting, but so far none work as expected and none send a pop-up note of any type in front of someone in the GUI. They will only get the message if they happen to be working in the terminal at the time, and even then might not spot it. Someone earlier mentioned they have tested Wall and it works: Well, it does *not* pop up a message or notification into the GUI, only to terminals. If you are in a terminal started within the GUI, you will get the message *in the terminal window*, but if the window is minimized, or you are not looking in the terminal at the time, you will see nothing. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org