tmenu

examples:

Input:

maniyar@mani-desktop ~/D/tmenu (master)> ./tmenu
1
2
3
4
5
6

Output:

┌──────────────────────────────────────────────────────────────────┐
│   1                                                              │
│                                                                  │
│                                                                  │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────┐
│   2                                                              │
│                                                                  │
│                                                                  │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────┐
│   3                                                              │
│                                                                  │
│                                                                  │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────┐ │ * 4 │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────┐ │ 5 │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────┐ │ 6 │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────┘

what is tmenu?

Tmenu was really my first (and only so far) mildly sizeable project in C. It uses a Makefile to build and has a minimal testing system in place that I didn't really use (in my opinion most unit testing libraries are 99loat). The idea stems from trying to get a replacement for dmenu in a strictly terminal setting, now it really doesn't fit the same niche but it does better than some Python alternatives that I frankly think run slower than dmenu itself.

how do i use it?

The usage is pretty much the same as dmenu, run the program and supply options delimited by newlines to standard input, then it should auto-populate an interactive menu where you can select an option. The selected option will then be printed in the standard output (for the above example the program would print "4").

how does it work?

The whole thing uses curses to create/draw the menu, and uses standard libc to parse everything out. The source code is decently clean if a bit convoluted, so I recommend taking a look if interested, most of the interesting bits are in input.c or main.c