wm-agnostic, X11 menu
Go to file
2021-04-29 20:09:10 -03:00
icons Adding some icons samples 2020-05-31 20:32:05 -03:00
CHANGELOG v4.5.5 2021-04-11 11:03:29 -03:00
config.h remove -t; prepare for mergint into master 2021-01-08 19:01:46 -03:00
config.mk Make standard for non-GNU 2021-01-08 07:01:20 -07:00
LICENSE fix license, add acknowledgements 2021-01-24 16:00:04 -03:00
Makefile Simplify DESTDIR 2021-01-10 14:01:51 -07:00
README.md replace image url 2021-04-11 10:32:24 -03:00
xmenu.1 STOP CAT ABUSE!!! 2021-04-29 20:09:10 -03:00
xmenu.c Fix: Handle missing (NULL pointer) output for separator. 2021-04-05 21:28:21 +02:00
xmenu.h add support for mouse scrolling (#26) 2021-02-13 20:36:55 -03:00
xmenu.sh STOP CAT ABUSE!!! 2021-04-29 20:09:10 -03:00

XMenu

XMenu is a menu utility for X. XMenu receives a menu specification in stdin, shows a menu for the user to select one of the options, and outputs the option selected to stdout. XMenu can be controlled both via mouse and via keyboard.

In order to generate a menu of applications based on .desktop entries, as specified by XDG, checkout xdg-xmenu by OliverLew.

Check out my other project, xclickroot for an application that can spawn xmenu by right clicking on the root window (i.e. on the desktop).

Features

XMenu comes with the following features:

  • XMenu reads something in and prints something out, the UNIX way.
  • Submenus (some menu entries can spawn another menu).
  • Separators (menu entries can be separated by a line).
  • Icons (menu entries can be preceded by an icon image).
  • X resources support (you don't need to recompile xmenu for configuring it).
  • Multi-head (xmenu supports multiple monitors by using Xinerama).
  • Type-to-select (you can select an item by typing part of its name).

Files

The files are:

  • ./README: This file.
  • ./Makefile: The makefile.
  • ./config.h: The hardcoded default configuration for XMenu.
  • ./config.mk: The setup for the makefile.
  • ./demo.gif: A gif demonstrating how XMenu works.
  • ./xmenu.1: The manual file (man page) for XMenu.
  • ./xmenu.c: The source code of XMenu.
  • ./xmenu.sh: A sample script illustrating how to use XMenu.
  • ./icons/: Icons for the sample script

Installation

First, edit ./config.mk to match your local setup.

In order to build XMenu you need the Imlib2, Xlib, Xinerama and Xft header files. The default configuration for XMenu is specified in the file config.h, you can edit it, but most configuration can be changed at runtime via X resources. Enter the following command to build XMenu. This command creates the binary file ./xmenu.

make

By default, XMenu is installed into the /usr/local prefix. Enter the following command to install XMenu (if necessary as root). This command installs the binary file ./xmenu into the ${PREFIX}/bin/ directory, and the manual file ./xmenu.1 into ${MANPREFIX}/man1/ directory.

make install

Running XMenu

XMenu receives as input a menu specification where each line is a menu entry. Each line can be indented with tabs to represent nested menus. Each line is made out of a label and a command separated by any number of tabs. Lines without labels are menu separators.

See the script ./xmenu.sh for an example of how to use XMenu to draw a simple menu with submenus and separators. The file ./demo.gif shows how the menu generated by that script looks like.

Read the manual for more information on running XMenu.

Acknowledgements

  • thingmenu for being the base for xmenu's code. However, xmenu evolved enough that it no longer resambles thingmenu at all.
  • dmenu for inspiring the stdin-to-stdout interface, and being base for drawing routines and input method code.