PMQUERY(1)
PMQUERY(1) π β¨
okay bestie, welcome to the group chat for pmquery β she lives in section 1 of the General Commands Manual and she's literally the queen of "hey, click a button for me" dialogs. Her government name is pmquery, and she brought her two besties pmconfirm and pmmessage along for the ride. π
β¨ NAME β¨
pmconfirm, pmmessage, pmquery β general purpose dialog box π (yes all three, they're a package deal, no cap)
β¨ SYNOPSIS β¨
pmconfirm [-c] [-b button-name] [-B default-button-name] [-t string]
[-file filename] [-icon icontype] [-font font] [-header titlebar-string]
[-useslider] [-noslider] [-noframe] [-exclusive]
pmmessage [-buttons label1[:value1][,label2[:value2][,...]]] [-center]
[-nearmouse] [-default button] [-file filename] [-print] [-timeout sec]
message...
pmquery [-input] [all above options...] [message...]
like. look at her. three whole moods. π¦
β¨ DESCRIPTION β¨
pmquery is serving you a command-line-option compatible implementation of the xconfirm and xmessage tools, but with a look-and-feel that's consistent with pmchart. She did not come to play β several extensions to the functionality of the original tools have been made, so she's extra useful specifically for pmchart, but wherever possible the original semantics remain. (loyal to her roots fr fr πΈ)
pmconfirm displays a line of text for each -t option specified (or a file when the -file option is used), and a button for each -b option specified. When one of the buttons is pressed, the label of that button is written to pmquery's standard output. That's a whole means of communication/feedback from within shell scripts, and a means to display useful information to a user from an application. slay, honestly. π
pmmessage displays a window containing a message from the command line, a file, or standard input. She additionally allows buttons to be associated with an exit status, and only optionally will write the label of the button to standard output. lowkey picky but we love her π
pmquery extends the above tools to additionally support limited user input, as free form text. In this -input mode, any text entered will be output when the default button is pressed. A default text can be entered using the same mechanisms as the other tools. main character energy, obviously. π
Command line options are available to specify font style, frame style, modality and one of several different icons to be presented for tailored visual feedback to the user. it's giving customizable β¨
β¨ OPTIONS β¨
The available command line options are:
-c,-centerβ Center the window on the display. π―-nearmouseβ Pop up the window near the mouse cursor. she follows your cursor around like a little duckling π-b button-nameβ Displays a button with the label button-name. If button-name is the empty string, the button in that position is not displayed. If no-boptions are present, the default is a button with the labelContinue. The exit status associated with button-name is zero. (soContinue=0, periodt π )-B button-nameβ Displays a button with the label button-name and specifies it as the button to be activated when enter is pressed. The exit status associated with button-name is zero. she's the default queen, the one who answers when you hit return β-buttons button,button,...β This option will create one button for each comma-separated button option. Each button consists of a label optionally followed by a colon and an exit value. The exit value will be returned if that button is selected. The default exit value is100plus the button number. Buttons are numbered from the left starting with one. (so the first one is101, iykyk π)-default labelβ Defines the button with a matching label to be the default. If not specified there is no default. The corresponding resource isdefaultButton. Pressing Return anywhere in thexmessagewindow will activate the default button. The default button has a wider border than the others. (wider border = she's built different π«Ά)-t messageβ Displays message. Any number of strings can be listed on the command line (each must be preceded with the-toption). stack 'em up π-file filenameβ Displays the file filename. All-toptions will be ignored. A filename of-reads from standard input. β οΈ careful bestie, that-terasure is real-icon icontypeβ Displays the icon icontype where icontype is one of:info,error,question,warning,critical.actionis also accepted as a synonym forerrorfor backward compatibility.pmqueryintroduces the additionalarchiveandhosticon types as well as the originalxconfirmtypes listed earlier. so many lil faces to choose from ππ-font fontnameβ Use fontname as the font. This option is only available when using the X Window System. π₯οΈ-header stringβ Use string as the window title. name her!! β¨-printβ This causes the program to write the label of the button pressed to standard output. It is the default behaviour forpmconfirmandpmquery. π£οΈ-noprintβ This causes the program to not write the label of the button pressed to standard output. It is the default behaviour forpmmessage. π€«-geometry geometry-stringβ This provides the tool with an X-compatible geometry string specification. This option is only available when using the X Window System. π-usesliderβ When displaying a file, always use a slider instead of determining automatically whether a slider is necessary. no thoughts, just slider ποΈ-nosliderβ Do not create a slider, and clip text to the window size, instead of determining automatically whether a slider is necessary.. (yes the double period is in the original, we respect her grammar choices π)-noframeβ Do not display a frame around the contents. minimalist era π§-exclusiveβ Grab the keyboard/pointer and do not allow further input until a button is pressed. she is HOLDING you hostage until you decide, no cap π-timeout secsβ Exit with status0after secs seconds if the user has not clicked on a button yet. The corresponding resource istimeout. ticking clock, bestie β°-?,-h,-helpβ Display usage message and exit. the "help me help you" trio π
β¨ EXAMPLES β¨
The following shell script will display a window with an information icon, asking the user a yes or no question with Yes as the default.
#! /bin/sh
case `pmquery -t "Really power down?" -b No -B Yes -icon question
in
Yes) shutdown;;
No) ;;
esac
A second example, which prompts for a hostname then starts a terminal with an ssh session connected to the requested host. π₯οΈπ
#! /bin/sh
host=`pmquery -input -icon host -b Cancel -B OK \
-header "Remote Terminal - Secure Shell"
[ "$host" = "Cancel" -o -z "$host" ] && exit
gnome-terminal -e "ssh $host"
β¨ ENVIRONMENT β¨
pmquery is an excellent choice of utility for the PCP_XCONFIRM_PROG Performance Co-Pilot configuration parameter (refer to pcp.conf(5) for details). literally the moment π
Note that PCP_XCONFIRM_PROG will be automatically set to pmquery inside tools like pmchart, unless PCP_XCONFIRM_PROG is already set in the environment. she self-nominates, iconic behavior π
β¨ EXIT STATUS β¨
If it detects an error, pmquery always returns 1, so this value should not be associated with a button. π¨
Unless -button option has not been used, the return code will be zero on success. (yes, that's the sentence. read it twice, it's fine π« )
β¨ SEE ALSO β¨
pmchart(1) and pcp.conf(5). go read your sisters' pages, bestie ππ
and that's the whole vibe check, babe β this page came from Performance Co-Pilot, and she's rocking the PMQUERY(1) tag. mwah, go click a button, love you, bye πβ¨ππ¦
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- centos-stream 9: pcp-doc 6.3.7-14.el9 Β· GPL-2.0-or-later AND CC-BY-3.0
- debian trixie: pcp-gui 6.3.8-1
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu questing: pcp-gui 6.3.8-1
- ubuntu resolute: pcp-gui 7.1.1-1
- ubuntu stonking: pcp-gui 7.2.1-2build1
- Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms