1GXMESSAGE(1) GXMESSAGE(1)
2
3
4
6 gxmessage - a GTK-based xmessage clone
7
9 gxmessage [OPTIONS] message ...
10 gxmessage [OPTIONS] -file FILENAME
11
13 gxmessage opens a window to display a message obtained from the command
14 line, from a file, or from stdin. The window includes a row of buttons,
15 each of which causes the program to exit with a different return code.
16
17 The GNU Info entry for gxmessage contains detailed information and
18 examples.
19
21 gxmessage should accept any option xmessage would, although some (such
22 as -bw and -xrm) are silently ignored. Options supported by gxmessage
23 are as follows:
24
25 -bg COLOR
26 Sets the background color of the message to COLOR. Examples:
27 red, "#c90", "#446a7e".
28
29 -borderless
30 Opens the gxmessage window without the usual window frame. This
31 option is not compatible with xmessage.
32
33 -buttons BUTTON_LIST
34 Defines the buttons to be created. BUTTON_LIST is a comma-sepa‐
35 rated list of LABEL:VALUE pairs, one for each button. The LABEL
36 is the text that appears on the button. The VALUE (0..255) is
37 the code the program will exit with if that button is pressed.
38 Commas and colons can be escaped using backslashes (\). As well
39 as ordinary text, the LABEL can specify a GTK "stock" button,
40 like "GTK_STOCK_CANCEL", or it can include an underscore (_) to
41 specify a keyboard accelerator. If VALUEs are omitted, they
42 default to 101, 102, 103, etc., in order. If no -buttons option
43 is given, BUTTON_LIST defaults to "okay:0".
44
45 gxmessage -buttons "Foo:42,Bar:63" "Example"
46 echo $?
47
48 gxmessage -buttons "_Foo,_Bar" "Example"
49 echo $?
50
51 gxmessage "Example"
52 echo $?
53
54 gxmessage -buttons "GTK_STOCK_OK:0" "Example"
55 echo $?
56
57 gxmessage -buttons "Hello\, world" "Example"
58
59
60 -center
61 Opens the gxmessage window in the middle of the screen.
62
63 -default LABEL
64 Opens the gxmessage window with input focused on the specified
65 button. LABEL is one of the LABELs in BUTTON_LIST (see -but‐
66 tons, above).
67
68 -display DISPLAY
69 Specifies the X display to use.
70
71 -encoding CHARSET
72 Specifies the encoding of the message text. By default, the mes‐
73 sage text is assumed to match the encoding of the current
74 locale. This option is not compatible with xmessage.
75
76 -entry
77 Adds a text entry box to the gxmessage window. When the window
78 closes, any text in the entry box will be copied to stdout. This
79 option is not compatible with xmessage and can't be used at the
80 same time as the -print option.
81
82 -entrytext TEXT
83 Same as -entry, but sets the default entry box contents to TEXT.
84 This option is not compatible with xmessage.
85
86 -fg COLOR
87 Sets the message text color to COLOR.
88
89 -file FILENAME
90 Causes the named file to be used as the message source. If a
91 dash (-) is used in place of FILENAME, the message will be read
92 from stdin.
93
94 -fn | -font FONT
95 Specifies the message font, using GTK2's font specification sys‐
96 tem. For example, -font "serif italic 14". (GTK2's font system
97 is not compatible with xmessage. See the Compatibility section,
98 below, for a workaround.)
99
100 -geometry GEOMETRY
101 Sets the window's size (position is ignored by gxmessage). Exam‐
102 ple: -geometry 400x200
103
104 -help
105 Displays basic usage information then exits.
106
107 -iconic
108 Opens the gxmessage window in its iconized (minimized) state.
109
110 -name NAME
111 Sets the gxmessage window's name to NAME.
112
113 -nearmouse
114 Opens the gxmessage window near the mouse pointer.
115
116 -nofocus
117 Prevents the gxmessage window from receiving focus when it
118 opens. This option is not compatible with xmessage.
119
120 -print
121 Writes the LABEL of the selected button to stdout.
122
123 -timeout SECONDS
124 Automatically closes the gxmessage window with an exit code of 0
125 if no button is pressed within SECONDS seconds. (The -entry and
126 -entrytext options cause -timeout to be ignored.)
127
128 -title TITLE
129 Sets the gxmessage window's title to TITLE.
130
131 -version
132 Displays the program's version number and Copyright details,
133 then exits. This option is not compatible with xmessage.
134
135 -wrap
136 Causes lines to wrap rather than exceed the width of the window.
137 This option is not compatible with xmessage.
138
140 The program's default appearance can be adjusted using GTK resource
141 files. The main text display widget is named gxmessage-textview. The
142 text entry widget is named gxmessage-entry.
143
144 # Example: ~/.gtkrc-2.0
145
146 style "gxmsg" {
147 text[NORMAL] = "#cc9900"
148 base[NORMAL] = "#660000"
149 text[SELECTED] = "#660000"
150 base[SELECTED] = "#cc9900"
151 font_name = "monospace"
152 }
153 widget "*.gxmessage-textview" style "gxmsg"
154 widget "*.gxmessage-entry" style "gxmsg"
155
156
158 If a button is pressed, the program returns the value assigned to that
159 button. The default "okay" button returns 0.
160
161 If a timeout event occurs, the program returns 0.
162
163 If an error occurs, or if the window is closed without a button-press
164 or timeout event, the program exits with code 1. Pressing the ESC key
165 also causes the program to exit with code 1.
166
168 Fall back to xmessage if gxmessage isn't available:
169
170 #! /bin/sh
171 XMESSAGE=$(which gxmessage) || XMESSAGE=xmessage
172 $XMESSAGE "hello, world"
173
174
175 If you specify fonts, check which program you're using:
176
177 font="monospace 14"
178 [ "$XMESSAGE" = xmessage ] && font="fixed"
179 $XMESSAGE ${font:+-fn "$font"} "hello, world"
180
181
182 Don't use double-dashed command line options:
183
184 $XMESSAGE "hello, world" -buttons good
185 $XMESSAGE "hello, world" --buttons bad
186
187
188 Don't use the gxmessage-specific options:
189
190 -entry, -entrytext, -borderless, -wrap,
191 -encoding, -nofocus, -version, -h, -?
192
193
195 The position component of -geometry values is ignored by gxmessage.
196
197 For some reason, opening the gxmessage window with no button set to be
198 the default causes GTK to emit a "beep" sound.
199
200 If you discover other bugs in the most recent version of gxmessage,
201 please get in touch.
202
204 xmessage(1), zenity(1), dialog(1)
205
206 The GNU Info entry for gxmessage contains detailed information and
207 examples.
208
210 Timothy Musson <trmusson@gmail.com>
211
213 Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009 Timothy Richard
214 Musson
215
216 Copying and distribution of this file, with or without modification,
217 are permitted provided the copyright notice and this notice are pre‐
218 served.
219
220
221
222
223 September 18th, 2009 GXMESSAGE(1)