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 -noescape
117 Prevents the window closing if the ESC key is pressed. This
118 option only works if a file named /usr/share/gxmes‐
119 sage/allow_noescape exists. This option is not compatible with
120 xmessage.
121
122 -nofocus
123 Prevents the gxmessage window from receiving focus when it
124 opens. This option is not compatible with xmessage.
125
126 -ontop
127 Attempts to keep the gxmessage window in front of other windows.
128 This option is not compatible with xmessage.
129
130 -print
131 Writes the LABEL of the selected button to stdout.
132
133 -sticky
134 Causes the gxmessage window to appear on all workspaces. This
135 option is not compatible with xmessage.
136
137 -timeout SECONDS
138 Automatically closes the gxmessage window with an exit code of 0
139 if no button is pressed within SECONDS seconds. (The -entry and
140 -entrytext options cause -timeout to be ignored.)
141
142 -title TITLE
143 Sets the gxmessage window's title to TITLE.
144
145 -version
146 Displays the program's version number and Copyright details,
147 then exits. This option is not compatible with xmessage.
148
149 -wrap
150 Causes lines to wrap rather than exceed the width of the window.
151 This option is not compatible with xmessage.
152
154 The program's default appearance can be adjusted using GTK resource
155 files. The main text display widget is named gxmessage-textview. The
156 text entry widget is named gxmessage-entry.
157
158 # Example: ~/.gtkrc-2.0
159
160 style "gxmsg" {
161 text[NORMAL] = "#cc9900"
162 base[NORMAL] = "#660000"
163 text[SELECTED] = "#660000"
164 base[SELECTED] = "#cc9900"
165 font_name = "monospace"
166 }
167 widget "*.gxmessage-textview" style "gxmsg"
168 widget "*.gxmessage-entry" style "gxmsg"
169
170
172 If a button is pressed, the program returns the value assigned to that
173 button. The default "okay" button returns 0.
174
175 If a timeout event occurs, the program returns 0.
176
177 If an error occurs, or if the window is closed without a button-press
178 or timeout event, the program exits with code 1. Pressing the ESC key
179 also causes the program to exit with code 1.
180
182 Fall back to xmessage if gxmessage isn't available:
183
184 #! /bin/sh
185 XMESSAGE=$(which gxmessage) || XMESSAGE=xmessage
186 $XMESSAGE "hello, world"
187
188
189 If you specify fonts, check which program you're using:
190
191 font="monospace 14"
192 [ "$XMESSAGE" = xmessage ] && font="fixed"
193 $XMESSAGE ${font:+-fn "$font"} "hello, world"
194
195
196 Don't use double-dashed command line options:
197
198 $XMESSAGE "hello, world" -buttons good
199 $XMESSAGE "hello, world" --buttons bad
200
201
202 Don't use the gxmessage-specific options:
203
204 -entry, -entrytext, -borderless, -wrap,
205 -encoding, -nofocus, -noescape, -ontop,
206 -sticky, -version, -h, -?
207
208
210 The position component of -geometry values is ignored by gxmessage.
211
212 For some reason, opening the gxmessage window with no button set to be
213 the default causes GTK to emit a "beep" sound.
214
215 If you discover other bugs in the most recent version of gxmessage,
216 please get in touch.
217
219 xmessage(1), zenity(1), dialog(1)
220
221 The GNU Info entry for gxmessage contains detailed information and
222 examples.
223
225 Timothy Musson <trmusson@gmail.com>
226
228 Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Timothy
229 Richard Musson
230
231 Copying and distribution of this file, with or without modification,
232 are permitted provided the copyright notice and this notice are pre‐
233 served.
234
235
236
237
238 February 25th, 2012 GXMESSAGE(1)