man gxmessage (Commandes) - a GTK-based xmessage clone
NAME
gxmessage - a GTK-based xmessage clone
SYNOPSIS
gxmessage [OPTIONS] message ...
gxmessage [OPTIONS] -file FILENAME
DESCRIPTION
gxmessage opens a window to display a message obtained from the command line, from a file, or from stdin. The window includes a row of buttons, each of which causes the program to exit with a different return code.
OPTIONS
gxmessage should accept any option xmessage would, although some (such as -bw and -xrm) are silently ignored. Options supported by gxmessage are as follows:
- -bg COLOUR
Sets the background colour of the message to COLOUR. Examples: red, "#446a7e", etc.- -borderless
Opens the gxmessage window without the usual window frame. This option is not compatible with xmessage.- -buttons BUTTON_LIST
Defines the buttons to be created. BUTTON_LIST is a comma-separated list of LABEL:VALUE pairs, one for each button. The LABEL is the text that appears on the button and the VALUE is the code the program will exit with if that button is pressed. The LABEL may be the name of one of the Gtk "stock" buttons, like "GTK_STOCK_CANCEL", or it may include an "_" to indicate the corresponding keyboard accelerator. If VALUEs are left out, they default to 101, 102, 103, etc., in order. If no -buttons option is given, BUTTON_LIST defaults to "okay:0". Examples: gxmessage -buttons "Foo:42,Bar:63" "Testing" echo $?
gxmessage -buttons "_Foo,_Bar" "Testing" echo $?
gxmessage "Testing" echo $?
gxmessage -buttons "GTK_STOCK_OK:0" "Testing" echo $?
- -center
Opens the gxmessage window in the middle of the screen.- -default LABEL
Opens the gxmessage window with input focused on the specified button. LABEL is one of the LABELs in BUTTON_LIST (see -buttons, above).- -display DISPLAY
Specifies the X display to use.- -encoding CHARSET
Specifies the encoding of the message text. By default, the message text is assumed to match the encoding of the current locale. This option is not compatible with xmessage.- -entry
Adds a text entry box to the gxmessage window. When the window closes, any text in the entry box will be copied to stdout. This option is not compatible with xmessage and can't be used at the same time as the -print option.- -entrytext TEXT
Same as -entry, but sets the default entry box contents to TEXT. This option is not compatible with xmessage.- -fg COLOUR
Sets the message text colour to COLOUR.- -file FILENAME
Causes the named file to be used as the message source. If a dash (-) is used in place of FILENAME, the message will be read from stdin.- -fn | -font FONT
Specifies the message font, using GTK2's font specification system. For example, -font "serif italic 14". (GTK2's naming system is not compatible with xmessage.)- -geometry GEOMETRY
Sets the window's size (position is ignored by gxmessage). Example: -geometry 400x200- -help
Displays basic usage information then exits.- -iconic
Opens the gxmessage window in its iconized (minimized) state.- -name NAME
Sets the gxmessage window's name to NAME.- -nearmouse
Opens the gxmessage window near the mouse pointer.- -nofocus
Prevents the gxmessage window from receiving focus when it opens. This option is not compatible with xmessage.
Writes the LABEL of the selected button to stdout.- -timeout SECONDS
Automatically closes the gxmessage window with an exit code of 0 if no button is pressed within SECONDS seconds.- -title TITLE
Sets the gxmessage window's title to TITLE.- -version
Displays the program's version number then exits. This option is not compatible with xmessage.- -wrap
Causes lines to wrap rather than exceed the width of the window. This option is not compatible with xmessage.
EXIT STATUS
The program returns code 1 if an error occurs, or if the window is closed without a button-press or timeout event.
COMPATIBILITY WITH XMESSAGE
Fall back to xmessage if gxmessage isn't available: #!/bin/bash XMESSAGE=$(which gxmessage) || XMESSAGE=xmessage $XMESSAGE "hello, world"
If you specify fonts, check which program you're using: font="monospace 14" [ "$XMESSAGE" = xmessage ] && font="" $XMESSAGE ${font:+-fn "$font"} "hello, world"
Don't use double-dashed command line options: $XMESSAGE "hello, world" -buttons good $XMESSAGE "hello, world" --buttons bad
Don't use the gxmessage-specific options: -entry, -entrytext, -borderless, -wrap, -encoding, -nofocus, -version, -h, -?
BUGS
gxmessage windows are often too small by default. (In xmessage, the window automatically sizes itself according to its contents, up to a maximum of 70 percent of screen width and height.)
The position component of -geometry values is ignored by gxmessage.
If you discover other bugs in the most recent version of gxmessage, please contact the author.
SEE ALSO
AUTHORS
Timothy Musson <trmusson@ihug.co.nz>