-
Notifications
You must be signed in to change notification settings - Fork 11
Home
pmenu - pie menu utility for X
pmenu [-w] [(-x|-X) [mod-]button]
pmenu is a pie menu for X, it reads a list of newline-separated items from stdin, shows a pie menu for the user to select one of the items, and outputs the item selected to stdout. The pie menu contains one slice for each item.
The options are as follows:
-
-w
Disable pointer warping when a new submenu spawns. This option is useful when using pmenu with a Wacom tablet.
-
-x [mod-]button
This option requires an argument of the form mod-button or button; where mod is Mod1 to Mod5, or Alt (equivalent to Mod1), or Super (equivalent to Mod4); and button is the number of a mouse button. When this option is used, pmenu listens to button presses on the root window, and shows the pie menu when the given button is pressed, together with the given modifier, on the root window. For example, invoking pmenu with the option -x Super-3 makes a menu open when clicking with the third mouse button on the root window, or when clicking with the third mouse button together with the Super (Mod4) modifier on any window. This option makes pmenu run continuously; so it should be used when pmenu is invoked in background on a X startup file (like ~/.xinitrc ).
-
-X [mod-]button
Just like -x, but also pass the click to the root window (for the window manager to use it, for example). This option is incompatible with -x.
Each item read from stdin has the following format:
ITEM := [TABS] [IMAGE TABS] LABEL [TABS OUTPUT] NEWLINE
That means that each item is composed by tabs, followed by an image specification, followed by more tabs and a label, followed by more tabs and an output, and ended by a newline. Brackets group optional elements.
The initial tabs indicate the menu hierarchy: items indented with a tab are shown in a submenu of the preceding item not indented. An item without initial tabs is a top-level item.
The image is a string of the form "IMG:/path/to/image.png". It specifies the path to a image file to be shown as icon in the slice. If the path does not begin with "/", "./" or "../", the file is searched on the paths specified in the ICONPATH environment variable.
The label is the string that will be shown as an item in the menu. If the item includes a icon, then no label is shown on the menu; however, a tooltip with the label pops up when hovering the icon.
The output is the string that will be output after selecting the item. If an item does not have an output, its label is used as its output. If the output begins with the $ character, then this string represents a command that will be run by pmenu using popen(3) and whose output will be used to generate a submenu.
The newline terminates the item specification.
pmenu is controlled by the mouse, but can also be controlled by the keyboard. Pie slices can be selected using Tab (with and without Shift), Enter and Esc.
-
Tab
Cycle through the slices in the clockwise direction.
-
Shift-Tab
Cycle through the items in the anticlockwise direction.
-
Enter
Select the highlighted item.
-
Esc
Go to the menu above or exit pmenu.
**** pmenu understands the following X resources.
-
pmenu.font
The font in which the labels should be drawn.
-
pmenu.background
The background color of non-selected slices in the menu.
-
pmenu.foreground
The color of the label text of non-selected slices in the menu.
-
pmenu.selbackground
The background color of selected slices in the menu.
-
pmenu.selforeground
The color of the label text of selected slices in the menu.
-
pmenu.border
The color of the border around the menu.
-
pmenu.separator
The color of the separator between slices in the menu.
-
pmenu.borderWidth
The size in pixels of the border around the menu.
-
pmenu.separatorWidth
The size in pixels of the slice separator.
-
pmenu.diameterWidth
The size in pixels of the pie menu.
The following environment variables affect the execution of pmenu.
-
DISPLAY
The display to start pmenu on.
-
ICONPATH
A colon-separated list of directories used to search for the location of image files.
The following script illustrates the use of pmenu. The output is redirected to sh(1), creating a command to be run by the shell.
#!/bin/sh
<<EOF pmenu | sh &
Apps
Firefox firefox
Chrome chromium
Vivaldi vivaldi
Gimp gimp
Terms
xterm xterm
urxvt urxvt
st st
Halt poweroff
Reboot reboot
EOF
For example, by selecting “Apps”, a new menu will appear. Selecting “Firefox” in the new menu opens firefox.
xmenu(1)