LinuxCommandLibrary

xmessage

Display simple X Window System message

SYNOPSIS

xmessage [options] message

PARAMETERS

-buttons button[,button...]
    Specifies the labels for the buttons. Defaults to 'OK'.

-center
    Centers the message window on the screen.

-default button
    Specifies the button to be the default (the one that's activated when Enter is pressed).

-file filename
    Reads the message from the specified file.

-font fontname
    Specifies the font to use for the message text.

-geometry geometry
    Specifies the size and position of the window.

-near mouse
    Positions window near the mouse cursor.

-timeout seconds
    Automatically dismisses the window after the specified number of seconds.

-title string
    Specifies the title of the window.

DESCRIPTION

The xmessage command displays a window containing a message. It's a simple way to present information to the user or get a response via button presses. It leverages the X Window System to create a graphical interface for displaying text. xmessage can display a variety of button options for user interaction, allowing scripts to make simple choices based on the user's selection. It is frequently used in shell scripts and other automated processes to provide feedback or prompt the user for input without requiring a full-fledged GUI application. The appearance and behavior of the dialog can be customized using various command-line options to adjust the size, font, title, and available buttons.

CAVEATS

xmessage relies on the X Window System. It will not work in a purely text-based environment or without a running X server.
The available buttons and their labels are limited, which can make creating complex interactions difficult.

EXIT CODES

xmessage returns an exit code corresponding to the button pressed. The exit code of the first button is 1, the second is 2, and so on. If the timeout expires, the exit code is 0. An error usually means the return code is 255.

HISTORY

xmessage has been a part of the X Window System for a long time, originating from the early days of X11. It was intended to provide a simple tool for displaying messages and getting basic input in a graphical environment. Its usage has diminished somewhat with the rise of more feature-rich dialog tools, but it remains useful for simple scripts where a lightweight solution is sufficient.

SEE ALSO

dialog(1), zenity(1), gxmessage(1)

Copied to clipboard