popup gui message from script - xmessage

I have a popup gui message from script - xmessage to signal when a virus scan is completed.

xmessage -center "scanvirus - scan completed"

Across linux distros, which commands are the most common? And package it needs, how to detect it?

opensuse 15.2 supports ‘xmessage’


Every GUI program has its command line, even dialog boxes too. zenity for gnome, kdialog for KDE, xmessage for other windows managers, etc.
In this example I am going to show you examples of xmessage and zenity.
xmessage is a very simple dialog box which uses by fluxbox, it allows you to define your text and buttons. Let say I want to create a shutdown script, before execute the shutdown, I would like to ask for comfirmation.

What about notify-send? Else dbus might be the other option.

I don’t have gnome, so no way to test it. So, please tell me if this is correct, based on working examples.

xmessage -nearmouse "SCANVIRUS - scan completed" -timeout 3

kdialog --title "SCANVIRUS" --passivepopup "scan completed" 3

zenity --notification --title="SCANVIRUS" --text="scan completed" --timeout 3

notify-send ‘Title of the message’ ‘Text of the message’

I installed ‘notify-osd’ and nothing happens.

I read about it and it requires ‘dbus’. Statement format for a general linux system.

It’s libnotify-tools;

cnf notify-send
Program 'notify-send' is present in package 'libnotify-tools'

notify-send 'IMPORTANT' "Important message" -u critical -i face-worried

notify-send 'IMPORTANT' "Important message" -u critical -i face-worried

Still nothing, no errors or messages.

[Keep]               libKF5NotifyConfig5            | Configuration dialog for desktop noti... | 5.71.0-lp152.1.1          |  146.3 KiB
[Keep]               libKF5NotifyConfig5-lang       | Translations for package knotifyconfig   | 5.71.0-lp152.1.1          |  191.1 KiB
[Keep]               libnotify-tools                | Notifications Library -- Tools           | 0.7.8-lp152.1.4           |   14.5 KiB
[Keep]               libnotify4                     | Notifications Library                    | 0.7.8-lp152.1.4           |   94.9 KiB

All installed.

I would have thought since it’s dbus centric it would have worked… seems some desktops are just not there yet (like dbuis and switherooctl)…

I’m using the KDE desktop.