menu - Basic xlib only popup menu program
          Original Copyright (C) 1999-2003 Elliot Hughes.
          Changes Copyright (C) 2004,2005, Terry Loveall <>
          Released under GPL 2.

Menu is a small vertical, xlib only, single parameter, general purpose mouse
and key driven pop-up menu. See the source for detailed technical operation.

Bug fixes, flames and code improvements can be sent to:
For other Xlib only apps on my home page see:


copy binary 'menu' to a $PATH specified directory such as /usr/local/bin. Copy
the files in sub-dir 'mime' to the same.

Supports right button click in other programs from my web-site, e.g. uxplor,
guiTAR, hacked dillo, txplor, retawq ...

usage: menu [[menu-file] parameter]

Optional menu-file path and file-name. With no menu-file defaults to '.menu'
in the current dir. If no menu-file found then defaults to a single menu
option of 'localhost' which fires up an xterm.

Optional: _one_ filespec parameter, _requires_ menu-file to be specified.
Parameter is passed on to menu options that contain the string '$F' in the
execution portion of the menu line.

Menu format:


<Menu_label> is any ASCII string not including a tab character. Spaces are
allowed. Tab character terminates <Menu_label>.

<tab> either terminates a <Menu_label> or, as the first character on a line,
causes the following <execution_string> to be executed DURING MENU-FILE
LOADING. Can be used for preprocessing before menu execution.

<execution_string> is the command line executed upon menu selection with a
left mouse button. A single parameter passed to the menu-file can be passed
to the specified command line by including the string '$F' (without the tick
marks) see file:/usr/X11R6/bin/.sendto for a working example.

e.g. 'Browser    dillo $F' (without the tick marks) displays the menu seletion,
'Browser' which will execute 'dillo' (which needs to be in the search path)
on the optional parameter $F.

menu is now keyboard driven in addition to mouse operation. Up, down
and <Enter> select and execute the highlighted menu option. <Esc> key
terminates menu without making a menu selection.

BTW in .sendto and .menu the command 'Cmd' is a shell script which I use
which fires up an rxvt term with my personal preferences, and 'edx' is a
homegrown xlib only X-win text editor.

Thanks Elliot.

Original README
To compile menu, type:


you should have a "menu" binary in the current directory.

Menu reads a .menu file from its current directory to decide what to
make available. I've provided my .menu file as an example.

    - Elliott Hughes, 1999-05-28