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