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 | |
571d99e1 | 7 | XMenu is a menu utility for X. |
8 | XMenu receives a menu specification in stdin, shows a menu for the user | |
a7732690 | 9 | to select one of the options, and outputs the option selected to stdout. |
883ec17f | 10 | XMenu can be controlled both via mouse and via keyboard. |
571d99e1 | 11 | |
70063f16 | 12 | In order to generate a menu of applications based on .desktop entries, |
13 | as specified by XDG, checkout [xdg-xmenu](https://github.com/OliverLew/xdg-xmenu) | |
14 | by [OliverLew](https://github.com/OliverLew). | |
15 | ||
47f3bbaf | 16 | Check out my other project, [xclickroot](https://github.com/phillbush/xclickroot) for an application that can |
d94ef325 | 17 | spawn xmenu by right clicking on the root window (i.e. on the desktop). |
18 | ||
571d99e1 | 19 | |
c1640685 | 20 | ## Features |
33376f54 | 21 | |
22 | XMenu comes with the following features: | |
b3419d47 GW |
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). | |
c15958bd | 28 | * X resources support (you don't need to recompile xmenu for configuring it). |
88341d20 | 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). | |
33376f54 | 31 | |
32 | ||
c1640685 | 33 | ## Files |
571d99e1 | 34 | |
35 | The files are: | |
47f3bbaf | 36 | |
70063f16 | 37 | * `./README`: This file. |
47f3bbaf GW |
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 | |
a7732690 | 46 | |
27443900 | 47 | |
c1640685 | 48 | ## Installation |
a7732690 | 49 | |
47f3bbaf | 50 | First, edit `./config.mk` to match your local setup. |
571d99e1 | 51 | |
dc1afe9f | 52 | In order to build XMenu you need the `Imlib2`, `Xlib`, `Xinerama` and `Xft` header files. |
47f3bbaf | 53 | The default configuration for XMenu is specified in the file `config.h`, |
571d99e1 | 54 | you can edit it, but most configuration can be changed at runtime via |
55 | X resources. Enter the following command to build XMenu. This command | |
47f3bbaf | 56 | creates the binary file `./xmenu`. |
a7732690 | 57 | |
571d99e1 | 58 | make |
a7732690 | 59 | |
47f3bbaf | 60 | By default, XMenu is installed into the `/usr/local` prefix. Enter the |
571d99e1 | 61 | following command to install XMenu (if necessary as root). This command |
47f3bbaf GW |
62 | installs the binary file `./xmenu` into the `${PREFIX}/bin/` directory, and |
63 | the manual file `./xmenu.1` into `${MANPREFIX}/man1/` directory. | |
a7732690 | 64 | |
571d99e1 | 65 | make install |
a7732690 | 66 | |
a7732690 | 67 | |
c1640685 | 68 | ## Running XMenu |
571d99e1 | 69 | |
70 | XMenu receives as input a menu specification where each line is a menu | |
a7732690 | 71 | entry. Each line can be indented with tabs to represent nested menus. |
72 | Each line is made out of a label and a command separated by any number | |
7fbd1c5e | 73 | of tabs. Lines without labels are menu separators. |
a7732690 | 74 | |
47f3bbaf | 75 | See the script `./xmenu.sh` for an example of how to use XMenu to draw a |
b3419d47 | 76 | simple menu with submenus and separators. The file `./demo.gif` shows how |
4f898cc3 | 77 | the menu generated by that script looks like. |
571d99e1 | 78 | |
0bb24147 | 79 | Read the [manual](https://github.com/phillbush/xmenu/wiki) for more information on running XMenu. |
88341d20 | 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. |