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