Update dmenu scripts

This commit is contained in:
2021-12-31 16:07:38 +01:00
parent 749fd7b3ac
commit 766c63824c
3 changed files with 26 additions and 0 deletions

13
.bin/dmenu-read Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Open pdf by title
# Note: does not handle incorrect metadata
dir=/home/h/doc/books
ag -g ".pdf$" $dir \
| xargs -n1 -d '\n' pdfinfo 2> /dev/null \
| grep "Title: " \
| awk '{for (i=2; i<NF; i++) printf $i " "; printf $NF; printf "\n"}' \
| grep -v "Title:"\
| dmenu -i -p "Read:"