From 12b30d57cf37fa289d904e6b120f83766ff02135 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Fri, 28 Aug 2020 17:12:18 +0300 Subject: added menu for man pages --- dotfiles/.local/bin/menuman | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 dotfiles/.local/bin/menuman (limited to 'dotfiles/.local/bin') diff --git a/dotfiles/.local/bin/menuman b/dotfiles/.local/bin/menuman new file mode 100755 index 0000000..868d801 --- /dev/null +++ b/dotfiles/.local/bin/menuman @@ -0,0 +1,21 @@ +#!/bin/sh +# Search and open man page + +list="$(man -k . | awk '{ print $1$2 }')" + +if [ "$1" = "-t" ]; then + chosen=$(printf "$list" | fzf) +else + # Source settings from .bemenurc + . ~/.config/bemenurc + + action="$TERMINAL -e" + chosen=$(printf "$list" | bemenu -p "Select man page:" -i -l 25 --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") +fi + +if [ -z "$chosen" ]; then + exit 0 +fi + +[ -n "$action" ] && $action "man $chosen" && exit 0 +man $chosen -- cgit v1.2.3