From 02e4686ccd7c95c6df855be61496c75c92b11396 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 6 Dec 2023 01:30:57 +0100 Subject: scripts: Move many scripts from sh to andy --- .local/bin/woman | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to '.local/bin/woman') diff --git a/.local/bin/woman b/.local/bin/woman index bbabc8e..c68728d 100755 --- a/.local/bin/woman +++ b/.local/bin/woman @@ -1,12 +1,16 @@ -#!/bin/sh +#!/usr/local/bin/andy -apropos . \ -| sed -E 's/ (\([^)]+\))\s*-/\1 —/' \ -| sort \ -| osel \ -| sed 's/\s.*//' \ -| { - IFS= read -r page - [ -n "$page" -a ! -t 2 ] && man -Tpdf "$page" | zathura - - [ -n "$page" -a -t 2 ] && man "$page" +# TODO: -s flag to apropos + +apropos . +| sed -E 's/ (\([^)]+\))\s*-/\1 —/' +| sort +| osel +| sed 's/\s.*//' +| read page + +if test -n $page -a ! -t 2 { + man -Tpdf $page | zathura - +} else if test -n $page -a -t 2 { + man $page } -- cgit v1.2.3