[download]

local/bin/man-menu

   1 #!/bin/bash
   2 
   3 d=/usr/share/doc/arch-wiki/html/en
   4 
   5 manpages(){ # {{{
   6     man -k . | tr ' ' '|' |
   7     sed 's/$/ - Manpage/' |
   8     column -t | tr '|' ' '
   9 } # }}}
  10 archwiki(){ # {{{
  11     cd $d &&
  12     find * -name '*.html' |
  13     sed 's/\.html$/ - Archwiki/' |
  14     column -t
  15 } # }}}
  16 
  17 while read i; do
  18     [[ $i == *Manpage  ]] && term man ${i// *} &
  19     [[ $i == *Archwiki ]] && chromium file://$d/${i// *}.html &
  20 done < <({ manpages; archwiki; } | menu -i man -l 15)