rm demo.gif
[xmenu] / README.md
... / ...
CommitLineData
1# XMenu
2
3<p align="center">
4 <img src="https://user-images.githubusercontent.com/63266536/114306062-ffb67000-9ab0-11eb-9a10-be30eadc68b4.gif", title="demo"/>
5</p>
6
7XMenu is a menu utility for X.
8XMenu receives a menu specification in stdin, shows a menu for the user
9to select one of the options, and outputs the option selected to stdout.
10XMenu can be controlled both via mouse and via keyboard.
11
12In order to generate a menu of applications based on .desktop entries,
13as specified by XDG, checkout [xdg-xmenu](https://github.com/OliverLew/xdg-xmenu)
14by [OliverLew](https://github.com/OliverLew).
15
16Check out my other project, [xclickroot](https://github.com/phillbush/xclickroot) for an application that can
17spawn xmenu by right clicking on the root window (i.e. on the desktop).
18
19
20## Features
21
22XMenu comes with the following features:
23
24* XMenu reads something in and prints something out, the UNIX way.
25* Submenus (some menu entries can spawn another menu).
26* Separators (menu entries can be separated by a line).
27* Icons (menu entries can be preceded by an icon image).
28* X resources support (you don't need to recompile xmenu for configuring it).
29* Multi-head (xmenu supports multiple monitors by using Xinerama).
30* Type-to-select (you can select an item by typing part of its name).
31
32
33## Files
34
35The files are:
36
37* `./README`: This file.
38* `./Makefile`: The makefile.
39* `./config.h`: The hardcoded default configuration for XMenu.
40* `./config.mk`: The setup for the makefile.
41* `./demo.gif`: A gif demonstrating how XMenu works.
42* `./xmenu.1`: The manual file (man page) for XMenu.
43* `./xmenu.c`: The source code of XMenu.
44* `./xmenu.sh`: A sample script illustrating how to use XMenu.
45* `./icons/`: Icons for the sample script
46
47
48## Installation
49
50First, edit `./config.mk` to match your local setup.
51
52In order to build XMenu you need the `Imlib2`, `Xlib`, `Xinerama` and `Xft` header files.
53The default configuration for XMenu is specified in the file `config.h`,
54you can edit it, but most configuration can be changed at runtime via
55X resources. Enter the following command to build XMenu. This command
56creates the binary file `./xmenu`.
57
58 make
59
60By default, XMenu is installed into the `/usr/local` prefix. Enter the
61following command to install XMenu (if necessary as root). This command
62installs the binary file `./xmenu` into the `${PREFIX}/bin/` directory, and
63the manual file `./xmenu.1` into `${MANPREFIX}/man1/` directory.
64
65 make install
66
67
68## Running XMenu
69
70XMenu receives as input a menu specification where each line is a menu
71entry. Each line can be indented with tabs to represent nested menus.
72Each line is made out of a label and a command separated by any number
73of tabs. Lines without labels are menu separators.
74
75See the script `./xmenu.sh` for an example of how to use XMenu to draw a
76simple menu with submenus and separators. The file `./demo.gif` shows how
77the menu generated by that script looks like.
78
79Read the [manual](https://github.com/phillbush/xmenu/wiki) for more information on running XMenu.
80
81
82## Acknowledgements
83
84* [thingmenu](https://github.com/singpolyma/thingmenu) for being the base
85 for xmenu's code. However, xmenu evolved enough that it no longer resambles
86 thingmenu at all.
87* [dmenu](https://tools.suckless.org/dmenu/) for inspiring the stdin-to-stdout
88 interface, and being base for drawing routines and input method code.