GXMESSAGE(1)
β¨ gxmessage π the GTK xmessage clone that SERVES β¨
okay bestie, so you know xmessage? the little popup window thing? yeah. gxmessage is that, but GTK, and honestly it's giving main character energy. it's a manual page for the gxmessage command, section 1 of the manual, and i'm about to tell you EVERYTHING about it. no gatekeeping here π«Ά
πΈ SYNOPSIS πΈ
like, here's how you actually call it:
gxmessage [OPTIONS] message ...
gxmessage [OPTIONS] -file FILENAME
π¦ DESCRIPTION π¦
so gxmessage opens a whole window to display a message. and the message can come from the command line, from a file, or from stdin. she's flexible like that π
and inside that window? a row of buttons. every button makes the program exit with a different return code, which is the whole point β you press a button, you get a number back. iconic behaviour tbh.
the GNU Info entry for gxmessage has the detailed info and examples, if you want the extended lore. iykyk π
β¨ OPTIONS β¨
gxmessage accepts any option xmessage would, no cap. although some of them β like -bw and -xrm β are just... silently ignored. they get the vibe check and fail it. π
-bg COLORβ sets the background color of the message to COLOR. examples:red,"#c90","#446a7e". cute!-buttons BUTTON_LISTβ defines the buttons to be created. BUTTON_LIST is a comma-separated list ofLABEL:VALUEpairs, one for each button. the LABEL is the text that shows up on the button. the VALUE (0..255) is the code the program will exit with if that button gets pressed. commas and colons can be escaped using backslashes (\). and β plot twist β as well as ordinary text, the LABEL can specify a GTK "stock" button, like"GTK_STOCK_CANCEL", or it can include an underscore (_) to specify a keyboard accelerator. if VALUEs are omitted, they default to101,102,103, etc., in order. and if no-buttonsoption is given at all, BUTTON_LIST defaults to"okay:0". the examples, bestie:
gxmessage -buttons "Foo:42,Bar:63" "Example"
echo $?
gxmessage -buttons "_Foo,_Bar" "Example"
echo $?
gxmessage "Example"
echo $?
gxmessage -buttons "GTK_STOCK_OK:0" "Example"
echo $?
gxmessage -buttons "Hello\, world" "Example"
-centerβ opens thegxmessagewindow smack in the middle of the screen. centered. balanced. zen. π§-default LABELβ opens the window with the input focused on the specified button. LABEL is one of the LABELs in BUTTON_LIST (peep-buttonsabove π).-display DISPLAYβ specifies the X display to use.-fg COLORβ sets the message text color to COLOR.-file FILENAMEβ makes the named file the message source. if you use a dash (-) in place of FILENAME, the message gets read from stdin. slay.-fn|-font FONTβ specifies the message font, using GTK's font specification system. for example,-font "serif italic 14". heads up though β GTK's font system is not compatible withxmessage. check the Compatibility section below for the workaround π«-geometry GEOMETRYβ sets the window's size and/or position. examples:
-geometry 400x200
-geometry 400x200+600+100
-geometry +600+100
-helpβ displays basic usage information, then dips out.-iconicβ opens the window in its iconized (minimized) state. she's shy π«£-name NAMEβ sets the window's name to NAME.-nearmouseβ opens the window near the mouse pointer. following you around fr fr π-printβ writes the LABEL of the selected button to stdout.-timeout SECONDSβ automatically closes the window with an exit code of0if no button is pressed within SECONDS seconds. β° (tho the-entryand-entrytextoptions cause-timeoutto be ignored. rude.)-title TITLEβ sets the window's title to TITLE.
π GXMESSAGE SPECIFIC OPTIONS π
these ones are exclusive to gxmessage β they are not compatible with xmessage. so don't go trying them over there, bestie, it won't work.
-borderlessβ opens the window without the usual window frame. no frame, no notes π-encoding CHARSETβ specifies the encoding of the message text. by default, the message text is assumed to match the encoding of the current locale.-entryβ adds a text entry box to the window. when the window closes, any text in the entry box gets copied to stdout. π this option can't be used at the same time as the-printoption β pick a lane, girl.-entrytext TEXTβ same as-entry, but sets the default entry box contents to TEXT.-noescapeβ prevents the window closing if the ESC key is pressed. β οΈ this option only works if a file named/usr/share/gxmessage/allow_noescapeexists. like, it literally will not do anything otherwise.-nofocusβ prevents the window from receiving focus when it opens.-ontopβ attempts to keep the window in front of other windows. main character energy, cannot be ignored β¨-stickyβ causes the window to appear on all workspaces.-versionβ displays the program's version number and Copyright details, then exits.-wrapβ causes lines to wrap rather than exceed the width of the window. because nobody likes horizontal scrolling π
π GTK DEFAULTS π
the program's default appearance can be adjusted using GTK resource files. the main text display widget is named gxmessage-textview. the text entry widget is named gxmessage-entry.
# Example: ~/.gtkrc-2.0
style "gxmsg" {
text[NORMAL] = "#cc9900"
base[NORMAL] = "#660000"
text[SELECTED] = "#660000"
base[SELECTED] = "#cc9900"
font_name = "monospace"
}
widget "*.gxmessage-textview" style "gxmsg"
widget "*.gxmessage-entry" style "gxmsg"
customize away, gorgeous π
π EXIT STATUS π
so here's the tea on what code you get back:
- if a button is pressed, the program returns the value assigned to that button. the default
"okay"button returns0. - if a timeout event occurs, the program returns
0. - if an error occurs, or if the window is closed without a button-press or timeout event, the program exits with code
1. and β plot twist β pressing the ESC key also causes the program to exit with code1. π
π COMPATIBILITY WITH XMESSAGE π
want to fall back to xmessage if gxmessage isn't available? here's the move:
#! /bin/sh
XMESSAGE=$(which gxmessage) || XMESSAGE=xmessage
$XMESSAGE "hello, world"
if you specify fonts, you gotta check which program you're actually using, bestie:
font="monospace 14"
[ "$XMESSAGE" = xmessage ] && font="fixed"
$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, -noescape, -ontop,
-sticky, -version, -h, -?
π BUGS π
for some reason, opening the gxmessage window with no button set to be the default causes GTK to emit a "beep" sound. like. why. nobody asked. π
if you discover other bugs in the most recent version of gxmessage, please get in touch! she wants to hear from you π«Ά
π₯ SEE ALSO π₯
xmessage(1), zenity(1), dialog(1)
the GNU Info entry for gxmessage contains detailed information and examples. (yes, i said it twice. it's important, okay?)
πΈ AUTHORS πΈ
Timothy Musson <trmusson@gmail.com>
π COPYRIGHT NOTICE π
Copyright Β© 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012, 2015 Timothy Richard Musson
copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved.
and that's the whole page, bestie!! π this one's from May 25th, 2015, GXMESSAGE(1), and it ATE. go forth and pop up some windows πβ¨π
π¦ where this page comes from
- debian bookworm: gxmessage 3.4.3-1+b2 Β· GPL-3.0-or-later
- debian trixie: gxmessage 3.4.3-2+b1 Β· GPL-3.0-or-later
- ubuntu jammy: gxmessage 3.4.3-1 Β· GPL-3.0-or-later
- ubuntu noble: gxmessage 3.4.3-2build2 Β· GPL-3.0-or-later
- ubuntu questing: gxmessage 3.4.3-2build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms