Part 46 of the 66-part series called "moon photos"
I must admit, today I sifted through titles to find one that could fit what I did, instead of tailoring what I did around a randomly-selected title. However, I think this is better than the last two Sundays, when I missed writing anything altogether. But since I wanted to showcase something I’ve written, I’m calling today’s post Vanity jar. Nothing with the words
menu were in my moonphoto list.
I really like dmenu, which is a simple menu that takes input from
stdin, allows the user to select one by typing, Tabbing or pointing, and prints it to
stdout, to be processed by another program in the pipeline. Many people use it as a program launcher, but it can be used for just about anything.
I also really like fzf, which is a fuzzy finder — that is, a program similar to dmenu in that it interactively narrows a large number of items to one selection, but it uses fuzzy matching, which means it allows the user to type non-contiguous letters of what they’re looking for.
I wanted to set up fzf like dmenu,There is a patch that adds fuzzy searching for dmenu, but I didn’t like how it worked. I also wanted this challenge, of course. but since it’s a commandline program figuring out
stdout was a challenge. I couldn’t figure out how to pipe text straight into a terminal, so I used temporary files.
The script as it stands uses the st terminal in addition to fzf. It could easily be changed to use another terminal, however.