An adaptive, half-manual, menu builder intended to be used in conjunction with labwc or Openbox.
Find a file
2025-03-26 22:35:52 +01:00
example document multiple tests 2025-03-17 20:45:08 +01:00
extra generalize menu-printer and extend its documentation 2025-03-15 01:25:13 +01:00
.gitignore add .gitignore file 2025-03-04 23:21:23 +01:00
compile_strict remove check for unused dependency 2025-03-17 20:57:35 +01:00
LICENSE.txt first commit 2025-03-04 23:16:31 +01:00
menu-builder.c begin separating lines into individual sections with individual lengths 2025-03-26 22:35:52 +01:00
README.md document compilation 2025-03-17 20:58:01 +01:00

This program allows creating a “dynamic” menu. The menu is intended to be used within labwc, but since you configure the “outline” by yourself, you most likely can also adapt this to Openbox and all other compositors or window managers that use the same menu syntax.

Usage

After compilation/installation just run the menu builder binary and provide all the menucsv files you want to parse.

menu-builder menu1.menucsv menu2.menucsv anotherone.menucsv

The menus are parsed as described in the example documentation and printed to the standard output. So you can either use this a s a pipe menu source script or for dynamically creating a static menu by redirecting the output to the menu.xml file.

You can also invoke the labwc-menu-printer script that automates that a little. See Documentation for that script.

Arch Package

This program is also available as package for Arch Linux from the AUR. The AUR package installs the documentation as manpages.

Compilation

If you prefer to compile the menu builder on your own, you can do so with no dependencies.

gcc \
  -o menu-builder \
  menu-builder.c

You can also provide two variables for compilation.

gcc \
  -DMAX_LINE_LENGTH=X \
  -DMAX_TESTS=Y \
  -o menu-builder \
  menu-builder.c

X is the maximum line length from the beginning of the line, including all tokens, up to the end of the line. If you have multiple long test paths or long commands, you might want to change this. By default 256 characters are used.

Y is the amount of tests. By default 5 tests are possible. If you want to check for more than 5 files, you can raise the limit here. Please note that all tests are counted in for the MAX_LINE_LENGTH, so you might raise both values.

For testing purposes the software was compiled with 2560 for the line length and 50 for the amount of tests and a couple of hundreds of menu lines to check, without any noticeable delay on a circa 10 years old computer.

So, its fine(?) … Just be reasonable 🙂