Linux "xmessage" Command Line Options and Examples
display a message or query in a window

The xmessage program displays a window containing a message from the command line, a file, or standard input. Along the lower edge of the message is row of buttons; clicking the left mouse button on any of these buttons will cause xmessage to exit.


Usage:

xmessage [ -buttons label1[:value1],label2[:value2], ... ] [ options ] -file filename
    xmessage [ -buttons label1[:value1],label2[:value2], ... ] [ options ] message ...






Command Line Options:

-buttons
This option will cause xmessage to create one button for each comma-separated button argument. Thecorresponding resource is buttons. Each button consists of a label optionally followed by a colon andan exit value. The label is the name of the Command button widget created and will be the defaulttext displayed to the user. Since this is the name of the widget it may be used to change any of theresources associated with that button. The exit value will be returned by xmessage if that button isselected. The default exit value is 100 plus the button number. Buttons are numbered from the leftstarting with one. The default string if no -buttons option is given is okay:0.
xmessage -buttons ...
-default
Defines the button with a matching label to be the default. If not specified there is no default.The corresponding resource is defaultButton. Pressing Return anywhere in the xmessage window willactivate the default button. The default button has a wider border than the others.
xmessage -default ...
-file
File to display. The corresponding resource is file. A filename of `-' reads from standard input.If this option is not supplied, xmessage will display all non-option arguments in the style of echo.Either -file or a message on the command line should be provided, but not both.
xmessage -file ...
-center
Pop up the window at the center of the screen. Equivalent to setting the center resource to TRUE.
xmessage -center ...
-nearmouse
Pop up the window near the mouse cursor. Equivalent to setting the nearMouse resource to TRUE.
xmessage -nearmouse ...
-timeout
Exit with status 0 after secs seconds if the user has not clicked on a button yet. The correspondingresource is timeout.WIDGET HIERARCHYKnowing the name and position in the hierarchy of each widget is useful when specifying resources for them.In the following chart, the class and name of each widget is given.Xmessage (xmessage)Form formText messageCommand (label1)Command (label2)...RESOURCESThe program has a few top-level application resources that allow customizations that are specific to xmessage.file A String specifying the file to display.buttons A String specifying the buttons to display. See the -buttons command-line option.defaultButtonA String specifying a default button by label.printValueA Boolean value specifying whether the label of the button pressed to exit the program is written tostandard output. The default is FALSE.center A Boolean value specifying whether to pop up the window at the center of the screen. The default isFALSE.nearMouseA Boolean value specifying whether to pop up the window near the mouse cursor. The default is FALSE.timeout The number of seconds after which to exit with status 0. The default is 0, which means never timeout.maxHeight (class Maximum)The maximum height of the text part of the window in pixels, used if no size was specified in thegeometry. The default is 0, which means use 70% of the height of the screen.maxWidth (class Maximum)The maximum width of the text part of the window in pixels, used if no size was specified in the geom‐etry. The default is 0, which means use 70% of the width of the screen.ACTIONSexit(value)exit immediately with an exit status of value (default 0). This action can be used with translationsto provide alternate ways of exiting xmessage.default-exit()exit immediately with the exit status specified by the default button. If there is no default button,this action has no effect.EXIT STATUSIf it detects an error, xmessage returns 1, so this value should not be used with a button.
xmessage -timeout ...