xmenu: my first project with xlib - Programming On Unix

Users browsing this thread: 1 Guest(s)
z3bra
Grey Hair Nixers
I didn't test yours, but I like the submenu idea built into it ☺ And don't worry about the name, I chose it because I lack a better name. This is only a toy project and not something big that I plan on sharing/advertising (hence the lack of documentation as well).

Mine works by ordering all arguments into a menu (no submenu support), and print the selected entry to stdout.

I use it like so, where each argument is a command in my $PATH that can be directly executed by the shell.
The ugly "while" loop is needed to fork the commands and make the whole thing asynchronous.
The "-d" flag is meant to daemonize the menu, and have it pop on mouse click events on the root window (just like cwm or rio menus). You click the root window, hold it down, select an entry, and release it to validate.

Code:
xmenu -d \
        'drawterm' \
        'killw $(slw)' \
        'reshape' \
        'snarf' \
        'plumb' \
        'st -e irc' \
        'st -e mutt' \
        | while read x; do sh -c "$x & exit"; done 2>/dev/null


Messages In This Thread
xmenu: my first project with xlib - by seninha - 14-05-2020, 06:45 PM
RE: xmenu: my first project with xlib - by z3bra - 14-05-2020, 07:32 PM
RE: xmenu: my first project with xlib - by venam - 15-05-2020, 02:47 AM
RE: xmenu: my first project with xlib - by z3bra - 15-05-2020, 06:33 AM
RE: xmenu: my first project with xlib - by movq - 15-05-2020, 09:49 AM
RE: xmenu: my first project with xlib - by venam - 15-05-2020, 03:04 PM
RE: xmenu: my first project with xlib - by venam - 19-05-2020, 12:49 AM
RE: xmenu: my first project with xlib - by opfez - 29-07-2020, 01:17 PM