From 766c63824ccf6e99ebe18990cc2e440ec9265c89 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Fri, 31 Dec 2021 16:07:38 +0100 Subject: [PATCH] Update dmenu scripts --- .bin/dmenu-read | 13 +++++++++++++ .bin/dmenu-spot | 12 ++++++++++++ .bin/dmenu-trans | 1 + 3 files changed, 26 insertions(+) create mode 100755 .bin/dmenu-read create mode 100755 .bin/dmenu-spot diff --git a/.bin/dmenu-read b/.bin/dmenu-read new file mode 100755 index 0000000..7790efa --- /dev/null +++ b/.bin/dmenu-read @@ -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