2020-07-29 22:03:09 +02:00
|
|
|
<p align="center">
|
|
|
|
<img src="/demo.gif", title="demo"/>
|
2020-08-05 14:30:08 +02:00
|
|
|
</p>
|
2020-07-30 21:51:29 +02:00
|
|
|
|
2020-07-29 22:04:37 +02:00
|
|
|
# XMenu
|
2020-07-30 21:51:29 +02:00
|
|
|
|
2020-05-27 16:19:49 +02:00
|
|
|
XMenu is a menu utility for X.
|
|
|
|
XMenu receives a menu specification in stdin, shows a menu for the user
|
2020-05-16 00:02:23 +02:00
|
|
|
to select one of the options, and outputs the option selected to stdout.
|
2020-08-24 03:26:23 +02:00
|
|
|
XMenu can be controlled both via mouse and via keyboard.
|
2020-05-27 16:19:49 +02:00
|
|
|
|
2020-08-05 14:30:08 +02:00
|
|
|
In order to generate a menu of applications based on .desktop entries,
|
|
|
|
as specified by XDG, checkout [xdg-xmenu](https://github.com/OliverLew/xdg-xmenu)
|
|
|
|
by [OliverLew](https://github.com/OliverLew).
|
|
|
|
|
2020-07-29 22:09:10 +02:00
|
|
|
Check out my other project, [xclickroot](https://github.com/phillbush/xclickroot) for an application that can
|
2020-06-24 19:24:22 +02:00
|
|
|
spawn xmenu by right clicking on the root window (i.e. on the desktop).
|
|
|
|
|
2020-05-27 16:19:49 +02:00
|
|
|
|
2020-07-29 22:04:37 +02:00
|
|
|
## Features
|
2020-06-01 01:29:46 +02:00
|
|
|
|
|
|
|
XMenu comes with the following features:
|
2020-07-29 22:16:59 +02:00
|
|
|
|
|
|
|
* XMenu reads something in and prints something out, the UNIX way.
|
|
|
|
* Submenus (some menu entries can spawn another menu).
|
|
|
|
* Separators (menu entries can be separated by a line).
|
|
|
|
* Icons (menu entries can be preceded by an icon image).
|
2020-07-30 21:51:29 +02:00
|
|
|
* X resources support (you don't need to recompile xmenu for configuring it).
|
2020-06-01 01:29:46 +02:00
|
|
|
|
|
|
|
|
2020-07-29 22:04:37 +02:00
|
|
|
## Files
|
2020-05-27 16:19:49 +02:00
|
|
|
|
|
|
|
The files are:
|
2020-07-29 22:09:10 +02:00
|
|
|
|
2020-08-05 14:30:08 +02:00
|
|
|
* `./README`: This file.
|
2020-07-29 22:09:10 +02:00
|
|
|
* `./Makefile`: The makefile.
|
|
|
|
* `./config.h`: The hardcoded default configuration for XMenu.
|
|
|
|
* `./config.mk`: The setup for the makefile.
|
|
|
|
* `./demo.gif`: A gif demonstrating how XMenu works.
|
|
|
|
* `./xmenu.1`: The manual file (man page) for XMenu.
|
|
|
|
* `./xmenu.c`: The source code of XMenu.
|
|
|
|
* `./xmenu.sh`: A sample script illustrating how to use XMenu.
|
|
|
|
* `./icons/`: Icons for the sample script
|
2020-05-16 00:02:23 +02:00
|
|
|
|
2020-05-24 03:06:21 +02:00
|
|
|
|
2020-07-29 22:04:37 +02:00
|
|
|
## Installation
|
2020-05-16 00:02:23 +02:00
|
|
|
|
2020-07-29 22:09:10 +02:00
|
|
|
First, edit `./config.mk` to match your local setup.
|
2020-05-27 16:19:49 +02:00
|
|
|
|
2021-01-08 19:50:30 +01:00
|
|
|
In order to build XMenu you need the `Imlib2`, `Xlib`, `Xinerama` and `Xft` header files.
|
2020-07-29 22:09:10 +02:00
|
|
|
The default configuration for XMenu is specified in the file `config.h`,
|
2020-05-27 16:19:49 +02:00
|
|
|
you can edit it, but most configuration can be changed at runtime via
|
|
|
|
X resources. Enter the following command to build XMenu. This command
|
2020-07-29 22:09:10 +02:00
|
|
|
creates the binary file `./xmenu`.
|
2020-05-16 00:02:23 +02:00
|
|
|
|
2020-05-27 16:19:49 +02:00
|
|
|
make
|
2020-05-16 00:02:23 +02:00
|
|
|
|
2020-07-29 22:09:10 +02:00
|
|
|
By default, XMenu is installed into the `/usr/local` prefix. Enter the
|
2020-05-27 16:19:49 +02:00
|
|
|
following command to install XMenu (if necessary as root). This command
|
2020-07-29 22:09:10 +02:00
|
|
|
installs the binary file `./xmenu` into the `${PREFIX}/bin/` directory, and
|
|
|
|
the manual file `./xmenu.1` into `${MANPREFIX}/man1/` directory.
|
2020-05-16 00:02:23 +02:00
|
|
|
|
2020-05-27 16:19:49 +02:00
|
|
|
make install
|
2020-05-16 00:02:23 +02:00
|
|
|
|
|
|
|
|
2020-07-29 22:04:37 +02:00
|
|
|
## Running XMenu
|
2020-05-27 16:19:49 +02:00
|
|
|
|
|
|
|
XMenu receives as input a menu specification where each line is a menu
|
2020-05-16 00:02:23 +02:00
|
|
|
entry. Each line can be indented with tabs to represent nested menus.
|
|
|
|
Each line is made out of a label and a command separated by any number
|
2020-05-16 03:51:26 +02:00
|
|
|
of tabs. Lines without labels are menu separators.
|
2020-05-16 00:02:23 +02:00
|
|
|
|
2020-07-29 22:09:10 +02:00
|
|
|
See the script `./xmenu.sh` for an example of how to use XMenu to draw a
|
2020-07-29 22:16:59 +02:00
|
|
|
simple menu with submenus and separators. The file `./demo.gif` shows how
|
2020-05-30 03:41:52 +02:00
|
|
|
the menu generated by that script looks like.
|
2020-05-27 16:19:49 +02:00
|
|
|
|
2020-07-29 23:19:47 +02:00
|
|
|
Read the [manual](https://github.com/phillbush/xmenu/wiki) for more information on running XMenu.
|