Either GUI message boxes, or message boxes that show inside the terminal.
It would also be interesting to be able to get simple input back from the user, e.g. yes / no or radio buttons.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
For a standard "box around a message", use
echo 'This is a test' | boxes
boxes will look like this (First one. Second one is a custom like
If you mean an alert box, use
notify-send 'title' 'message'
notify-send looks like this:
You also can use
zenity for a popup window:
zenity --error --text="An error occurred\!" --title="Warning\!"
Zenity is more graphical and has more options, like having the window appear as a question, using:
zenity --question --text="Do you wish to continue/?"
or even progress bars, using:
find /usr | zenity --progress --pulsate --auto-close --auto-kill --text="Working..."
zenity looks like this:
dialog, for a command-line only message box:
dialog --checklist "Choose OS:" 15 40 5 \ 1 Linux off \ 2 Solaris on \ 3 'HP UX' off \ 4 AIX off
dialog looks like this:
Another option is
whiptail --title "Example Dialog" --msgbox "This is an example of a message box. You must hit OK to continue." 8 78
whiptail looks like this:
And if you are truly crazy, use
toilet -F border -F gay "CRAZY"
toilet looks like this:
This is the granddaddy of GUI alerts:
xmessage -center "Hello, World!"
Pure retro goodness.
I also bet that it should be widely available on X11 systems.
Tested in Ubuntu 18.04.
And then just because @polym's completely over the top answer missed the classic messaging:
write <username> [<terminal>] - send a message to another user. Either interactively or as part of a pipe with
echo "message" | write username
And the complement to write,
wall to send a message to all users
If you are willing to pipe the text to a Python wrapper, you can use
pip3 install colorclass pip3 install terminaltables
Then in the GitHub Repo, you can use one of the examples to write a python wrapper.