From 17bd886e3ad960780954efeab04ad95ee18bcccb Mon Sep 17 00:00:00 2001 From: Rushmore75 Date: Tue, 3 Feb 2026 14:35:26 -0700 Subject: [PATCH] add recipies --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 8fbe368..713700e 100644 --- a/README.md +++ b/README.md @@ -47,4 +47,41 @@ This has some issues: Interestingly, I found the same trick they use to allow for menus to be printed but also pipe the output. By putting them menu on `stderr` instead of `stdout` you can have a menu that doesn't get yoinked by the pipe's reidrection. +# Recipies + +> Note: I have the program wrapper script on my `$PATH` and have the wrapper script renamed to `opts`. + + +Show all directories, entering the selected one. + +```bash +cd $(ls -la | grep dr | awk '{ print $9 }' | opts) +``` + +--- + +Show all partitions, mounting the selected one at `/mnt`. + +```bash +sudo mount $(lsblk -lno type,name | grep part | awk '{ print "/dev/" $2 }' | opts) /mnt +``` + +You could even do the filtering after the fact, to give the user more info. +```bash +sudo mount $(lsblk | opts | awk '{ print $1 }') /mnt +``` +(But this would allow you to select bad data.) + +--- + +Choose what video codec to change all the videos in the current directory to. + +```bash +OPTS="mpeg4\nh265\nh264" +SEL=$(printf $OPTS | opts) + +for x in $(ls); do + ffmpeg -i $x -v:c $SEL ${x}-enc.mp4 +done +```