XMESSAGE(1)
๐ xmessage ๐
okay so this is the manual page for xmessage, which is a Section 1 General Commands tool. it's basically /bin/echo but make it a window, and it's giving main character energy ๐โจ
๐ธ NAME ๐ธ
xmessage - display a message or query in a window (X-based /bin/echo) ๐ซถ
๐ SYNOPSIS ๐
xmessage [ -buttons label1[:value1],label2[:value2], ... ] [ options ]
-file filename
xmessage [ -buttons label1[:value1],label2[:value2], ... ] [ options ]
message ...
xmessage [ -help | -version ]
๐ DESCRIPTION ๐
okay so xmessage pops up a window with a message in it, and the message can come from the command line, a file, or standard input. ๐ฆ Along the bottom edge of the message there's a row of buttons, and if you left-click any of them, xmessage exits. ngl that's so satisfying ๐
Which button you clicked gets sent back in the exit status. You can also have it write the button's label to standard output if you want, which is lowkey iconic for scripts ๐ฅ
This is mostly used by shell scripts, either to show the user some info or to ask them to pick something. ๐ง
Unless you give it a size, xmessage sizes itself to fit the message, up to a maximum size. If the message is too big for the window, scroll bars show up so nothing gets lost ๐
๐ OPTIONS ๐
these are the command line options xmessage understands, on top of the standard ones listed in X(7) ๐
-buttons button,button,...โ this makes one button for each comma-separated button argument ๐ The matching resource isbuttons. Each button is a label, optionally followed by a colon and an exit value. The label is the name of theCommandbutton widget that gets created, and it's also the text the user sees by default. Since it's the widget's name, you can use it to change any resource for that button. The exit value is whatxmessagereturns if that button gets picked. The default exit value is 100 plus the button number, and buttons are numbered from the left starting at one. If you don't use-buttonsat all, the default isokay:0๐-default labelโ picks the button with a matching label as the default. If you don't set one, there's no default โจ The matching resource isdefaultButton. Hitting Return anywhere in thexmessagewindow will press the default button, and it gets a wider border than the others so you can spot it ๐-file filenameโ the file to display ๐ The matching resource isfile. If the filename is-, it reads from standard input. If you skip this option,xmessageshows every non-option argument, echo-style. You should give it either-fileor a message on the command line, but not both, bestie ๐ โโ๏ธ-printโ makes the program write the label of the pressed button to standard output ๐จ๏ธ It's the same as setting theprintValueresource toTRUE. This is a nice way to find out which button got clicked ๐ซถ-centerโ pops the window up in the center of the screen ๐ Same as setting thecenterresource toTRUE.-nearmouseโ pops the window up near the mouse cursor ๐ญ Same as setting thenearMouseresource toTRUE.-timeout secsโ exits with status0aftersecsseconds if nobody has clicked a button yet โฐ The matching resource istimeout.-helpโ prints a usage message and exits ๐-versionโ prints the version info and exits ๐ท๏ธ
๐ง WIDGET HIERARCHY ๐ง
knowing the name and position of each widget is super useful when you're setting resources for them ๐ฆ Here's the chart, with each widget's class and name:
Xmessage (xmessage)
Form form
Text message
Command (label1)
Command (label2)
.
.
.
โ๏ธ RESOURCES โ๏ธ
the program has a few top-level application resources for customizing xmessage stuff ๐
fileโ a String for the file to display ๐buttonsโ a String for the buttons to show. Check the-buttonscommand-line option ๐defaultButtonโ a String naming the default button by its label ๐printValueโ a Boolean for whether the pressed button's label gets written to standard output. The default isFALSE๐จ๏ธcenterโ a Boolean for whether the window pops up in the center of the screen. The default isFALSE๐nearMouseโ a Boolean for whether the window pops up near the mouse cursor. The default isFALSE๐ญtimeoutโ the number of seconds before it exits with status0. The default is0, which means it never times out โณmaxHeight(classMaximum) โ the max height of the text part of the window, in pixels. It's only used if no size was set in the geometry. The default is0, which means 70% of the screen height ๐maxWidth(classMaximum) โ the max width of the text part of the window, in pixels. Also only used if no size was set in the geometry. The default is0, which means 70% of the screen width ๐
๐ฌ ACTIONS ๐ฌ
exit(value)โ exits right away with an exit status ofvalue(default0) ๐ช You can hook this up in translations to make other ways of exitingxmessageโจdefault-exit()โ exits right away with the exit status of the default button ๐ If there isn't a default button, this action does absolutely nothing ๐
๐จ EXIT STATUS ๐จ
โ ๏ธ ifxmessageruns into an error, it returns1, so don't use1as a button's exit value, or you'll be very confused later ๐
๐ SEE ALSO ๐
๐งโ๐ป AUTHORS ๐งโ๐ป
Chris Peterson, MIT Project Athena ๐ Stephen Gildea, X Consortium ๐ซถ
bestie, that's the whole thing ๐ this is X Version 11, xmessage 1.0.7, and it's the XMESSAGE(1) page, periodt ๐โจ
๐ฆ where this page comes from
- alpine 3.24: xmessage-doc 1.0.7-r0 ยท MIT
- arch rolling: xorg-xmessage 1.0.7-2 ยท X11
- debian trixie: x11-utils 7.7+7
- epel 10: xmessage 1.0.7-2.el10_0 ยท X11
- epel 9: xmessage 1.0.7-1.el9 ยท X11
- fedora 43: xmessage 1.0.7-6.fc43 ยท X11
- fedora 44: xmessage 1.0.7-8.fc44 ยท X11
- nixos 26.05: xmessage 1.0.7
- nixpkgs unstable: xmessage 1.0.7
- opensuse-leap 16.0: xmessage 1.0.7-160000.2.2 ยท MIT
- opensuse-leap 16.0: xmessage 1.0.7-160000.2.2 ยท MIT
- opensuse-leap 16.0: xmessage 1.0.7-160000.2.2 ยท MIT
- opensuse-leap 16.0: xmessage 1.0.7-160000.2.2 ยท MIT
- ubuntu questing: x11-utils 7.7+7
- ubuntu resolute: x11-utils 7.7+7build1
- ubuntu stonking: x11-utils 7.7+7build1
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms