Commit | Line | Data |
---|---|---|
ba97c0d2 GW |
1 | <p align="center"> |
2 | <img src="/demo.gif", title="demo"/> | |
3 | </p> | |
571d99e1 | 4 | XMenu |
ba97c0d2 | 5 | |
571d99e1 | 6 | XMenu is a menu utility for X. |
7 | XMenu receives a menu specification in stdin, shows a menu for the user | |
a7732690 | 8 | to select one of the options, and outputs the option selected to stdout. |
571d99e1 | 9 | XMenu can be controlled both via mouse and via keyboard. The menu is a |
10 | pop-up menu (that is, after selecting an option, the menu disappears). | |
11 | ||
d94ef325 | 12 | Check out my other project, xclickroot[0] for an application that can |
13 | spawn xmenu by right clicking on the root window (i.e. on the desktop). | |
14 | ||
15 | [0]: https://github.com/phillbush/xclickroot | |
16 | ||
571d99e1 | 17 | |
33376f54 | 18 | § Features |
19 | ||
20 | XMenu comes with the following features: | |
21 | • XMenu reads something in and prints something out, the UNIX way. | |
22 | • Submenus (some menu entries can spawn another menu). | |
23 | • Separators (menu entries can be separated by a line). | |
d584fba6 | 24 | • Icons (menu entries can be preceded by an icon image). |
33376f54 | 25 | |
26 | ||
571d99e1 | 27 | § Files |
28 | ||
29 | The files are: | |
30 | • ./README: This file. | |
31 | • ./Makefile: The makefile. | |
32 | • ./config.h: The hardcoded default configuration for XMenu. | |
33 | • ./config.mk: The setup for the makefile. | |
ddeb6e1e | 34 | • ./demo.gif: A gif demonstrating how XMenu works. |
571d99e1 | 35 | • ./xmenu.1: The manual file (man page) for XMenu. |
36 | • ./xmenu.c: The source code of XMenu. | |
37 | • ./xmenu.sh: A sample script illustrating how to use XMenu. | |
33376f54 | 38 | • ./icons/: Icons for the sample script |
a7732690 | 39 | |
27443900 | 40 | |
a7732690 | 41 | § Installation |
42 | ||
571d99e1 | 43 | First, edit ./config.mk to match your local setup. |
44 | ||
33376f54 | 45 | In order to build XMenu you need the Imlib2, Xlib and Xft header files. |
571d99e1 | 46 | The default configuration for XMenu is specified in the file config.h, |
47 | you can edit it, but most configuration can be changed at runtime via | |
48 | X resources. Enter the following command to build XMenu. This command | |
49 | creates the binary file ./xmenu. | |
a7732690 | 50 | |
571d99e1 | 51 | make |
a7732690 | 52 | |
571d99e1 | 53 | By default, XMenu is installed into the /usr/local prefix. Enter the |
54 | following command to install XMenu (if necessary as root). This command | |
55 | installs the binary file ./xmenu into the ${PREFIX}/bin/ directory, and | |
56 | the manual file ./xmenu.1 into ${MANPREFIX}/man1/ directory. | |
a7732690 | 57 | |
571d99e1 | 58 | make install |
a7732690 | 59 | |
a7732690 | 60 | |
571d99e1 | 61 | § Running XMenu |
62 | ||
63 | XMenu receives as input a menu specification where each line is a menu | |
a7732690 | 64 | entry. Each line can be indented with tabs to represent nested menus. |
65 | Each line is made out of a label and a command separated by any number | |
7fbd1c5e | 66 | of tabs. Lines without labels are menu separators. |
a7732690 | 67 | |
4f898cc3 | 68 | See the script ./xmenu.sh for an example of how to use XMenu to draw a |
69 | simple menu with submenus and separators. The file ./demo.gif shows how | |
70 | the menu generated by that script looks like. | |
571d99e1 | 71 | |
72 | Read the manual for more information on running XMenu. | |
73 | ||
74 | ||
75 | § License | |
08f16589 | 76 | |
cdeaefaa | 77 | MIT/X Consortium License |
78 | ||
79 | © 2020 phillbush | |
80 | ||
81 | Permission is hereby granted, free of charge, to any person obtaining a | |
82 | copy of this software and associated documentation files (the "Software"), | |
83 | to deal in the Software without restriction, including without limitation | |
84 | the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
85 | and/or sell copies of the Software, and to permit persons to whom the | |
86 | Software is furnished to do so, subject to the following conditions: | |
87 | ||
88 | The above copyright notice and this permission notice shall be included in | |
89 | all copies or substantial portions of the Software. | |
90 | ||
91 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
92 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
93 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
94 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
95 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
96 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
97 | DEALINGS IN THE SOFTWARE. |