GPM-ROOT(1)
π GPM-ROOT(1) π β General Commands Manual
okay so this is the General Commands Manual page for gpm-root, and bestie we are about to have a whole moment about it π it's giving "tiny daemon, big personality" and I'm obsessed.
π NAME π
gpm-root β a default handler for gpm, used to draw menus on the root window.
β¨ SYNOPSIS β¨
gpm-root [ options ]
πΈ DESCRIPTION πΈ
So the program gpm-root is designed to handle Control-Mouse events to draw menus on the background of the current tty. And the actual menus? Those are described by a configuration file in the user's home directory. cute, right? π
Heads up fr fr: gpm-root needs to run with Linux 1.1.73 or newer, because previous kernels lack some screen handling capabilities required by the program. no cap.
The program uses the files /dev/vcs* to draw to the console screen. These are available only from kernel 1.1.81 onward. If you miss those device nodes, you should create them using create_vcs in the distribution directory. The tool won't run with kernels older than 1.1.81, because they lacked a full screen dump/restore capability. π
Available command line options are the following:
π the options π
-mnumber β choose the modifier to use (by default:control). The modifier can be provided either as a number or as a symbolic string. The allowed strings areshift,anyAlt,leftAlt,rightAlt,control.-uβ deny using user-specific configuration files. With this option on, only/etc/gpm-root.confwill be used as a source of configuration information. This option is intended for those system administrators who fear security could be broken by this daemon. Things should be sufficiently secure, but if you find a hole please tell me about it π«Ά-Dβ do not automatically enter background operation when started, and log messages to the standard error stream, not the syslog mechanism. This is useful for debugging; in previous releases it was done with a compile-time option.-Vverbosity increment β raise the maximum level of messages that will be logged. Thus a positive argument has the effect of making the program more verbose. One can also give a negative argument to hush the program; however, note that due togetopt(3)rules a negative argument must follow the option with no space betwixt (that is,-V-1but not-V -1). Program Arguments,,,libc. The argument is optional and its default value is1.
(yes the original page literally drops the words "Program Arguments,,,libc." in there and we are keeping every crumb of it, that's just how the lore is π)
Each time a menu is drawn, the configuration file is reparsed if it has changed. This allows modification of personal setup without reinvoking the daemon. slay, honestly. β¨
The actual configuration file is better introduced by looking at your /etc/gpm-root.conf.
The syntax for the file won't be described here, being it quite apparent from the example above. Blanks and newlines are unused in parsing the file, and the layout of the file is free. Comments are allowed in the file: any hash mark (#) found at the beginning of the line or after white space makes the parser discard anything up to the next line. To insert quotes (") in strings precede them with a backslash.
Note that recursive menus are allowed, to any level of recursion. π
Keywords belong to three groups: the button keyword, the cfg keywords and the action keywords. They are all described in the table below:
buttonnumber menu β thebuttonkeyword is used to introduce a menu. It is followed by the number of the relevant button (1=left,2=middle,3=right), an open brace, a menu and a closed brace. A menu is made up of cfg statements, followed by action statements. Cfg statements can come in any order, while the order of action statements tells the actual order in which actions will appear on the screen, top to bottom.
The following statements belong to the cfg set.
namestring β if thenamekeyword is present, the specified string will be used as the name for the current menu.backgroundcolor β this statement is used to specify the background color to be used in the current menu. The color can be specified with one of the eight canonical stringsblack,red,cyanetc. The background defaults toblack.foregroundcolor β this statement is used to specify the foreground color for menu items. Its value defaults towhite. An optionalbrightkeyword can appear before the actual color.bordercolor βborderis used to specify the border color for the menu. Its value defaults towhite. An optionalbrightkeyword can appear before the actual color.headcolor βheadis used to specify the foreground color for the title of the menu. Its value defaults towhite. An optionalbrightkeyword can appear before the actual color.
The following statements belong to the action set.
string f.fgcmd cmdstringβ when the mouse button is released above the corresponding menu item, thecmdstringis pasted in the keyboard queue of the current console. This is not yet implemented.string f.bgcmd cmdstringβ when the mouse button is released above the corresponding menu item, a shell (/bin/sh) is forked to execute the specified command, with stdin connected to/dev/null, and stdout, stderr connected to the active console.string f.jptty ttynumberβ when the mouse button is released above the corresponding menu item, the console is switched to the one specified. Thettynumbermust be specified as a string. Any tty can be reached this way, even those which are not accessible via the keyboard. iconic tbh πstring f.mktty ttynumberβ when the mouse button is released above the corresponding menu item, an unused console is selected, and/sbin/mingettyis executed in it. The current console is switched to the newly opened console. I use this command to save kernel memory by opening a single console through/etc/inittaband requesting the others only when i need to login.string Whole-menuβ a menu can directly follow the labelstring. When the mouse pointer leaves the menu frame at the level ofstring, a second menu is posted on screen.string f.lockβ when the mouse button is released above the corresponding menu item, the keyboard and the screen are locked, and only the locking user or the superuser can unlock them. This is not yet implemented.string f.loadβ the current loadavg when the menu is posted is concatenated tostringto build the actual message displayed on screen. Nothing happens at button release.string f.freeβ the free memory and swap when the menu is posted is concatenated tostringto build the actual message displayed on screen. Nothing happens at button release.string f.timeβ the current time is formatted withstrftime(3), according tostring. The resulting string is the actual message displayed on screen. Nothing happens at button release.string f.pipe cmdlineβ when the mouse pointer leaves the menu frame at the level ofstring, a message box is posted on screen showing the last ten lines of the output ofcmdline.cmdlineis executed by/bin/sh. This is not yet implemented.string f.nopβ this does nothing, it only displaysstringon the menu.
The HOME, LOGNAME and USER environment variables are setup to the values for the invoking user before spawning an external process (f.bgcmd, f.pipe). The current directory is always /.
π BUGS π
Known bugs have been fixed. In particular, if you invoke gpm-root right after gpm, it will delay a few seconds before trying to connect to the daemon. (yes bestie, patience is a personality trait πΈ)
π AUTHOR π
Alessandro Rubini <rubini@linux.it>
π FILES π
/dev/gpmctlβ the socket used to connect togpm./etc/gpm-root.confβ the default configuration file.$(HOME)/.gpm-rootβ the user configuration file./dev/vcs*β Virtual Console Screens
π SEE ALSO π
gpm(8)- The info file about
gpm, which gives more complete information and explains how to write a gpm client.
and that's the whole page, bestie π¦ this one came out of the 4th Berkeley Distribution back in February 1995 β vintage behavior, still iconic, periodt π β¨
π¦ where this page comes from
- alpine 3.22: gpm-doc 1.20.7-r5 Β· GPL-2.0-or-later
- alpine 3.23: gpm-doc 1.20.7-r6 Β· GPL-2.0-or-later
- alpine 3.24: gpm-doc 1.20.7-r6 Β· GPL-2.0-or-later
- arch rolling: gpm 1.20.7.r38.ge82d1a6-7 Β· GPL
- centos-stream 9: gpm 1.20.7-29.el9 Β· GPLv2 and OFSFDL
- epel 10: gpm 1.20.7-48.el10_1 Β· GPL-2.0-or-later AND LicenseRef-OFSFDL
- fedora 43: gpm 1.20.7-52.fc43 Β· GPL-2.0-or-later AND LicenseRef-OFSFDL
- fedora 44: gpm 1.20.7-53.fc44 Β· GPL-2.0-or-later AND LicenseRef-OFSFDL
- nixpkgs unstable: gpm 1.20.7-unstable-2020-06-17
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms