summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-23 19:20:22 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-23 19:20:22 +0100
commitcc7c6980da55eba15dd38bfd00f3e8fc1b454b7a (patch)
treee11c43464a2a866de8088cbd6e1e27628bec4e3b /.local
parent28874c7b31e8758c4302a0cb46e6300935bb3a21 (diff)
woman: Add script for opening manuals as PDFs
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/woman11
1 files changed, 11 insertions, 0 deletions
diff --git a/.local/bin/woman b/.local/bin/woman
new file mode 100755
index 0000000..b63dac2
--- /dev/null
+++ b/.local/bin/woman
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+apropos . \
+| sed -E 's/ (\([^)]+\))\s*-/\1 —/' \
+| sort \
+| osel \
+| sed -E 's/([^(]+)\(([^)]+)\).*/\2 \1/' \
+| {
+ read p s
+ [ -n "$p" -a -n "$s" ] && man -Tpdf "$p" "$s" | zathura -
+}