iomenu

interactive text selection menu
Log | Files | Refs | README | LICENSE

commit 7e90ef5eb5bebae51da05ea9f5fd0bb8eafaa98d
parent 3905e591078c229e7db64662c9f933bc1c7a504d
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 17 Jun 2018 19:06:12 +0200

add example scripts

Diffstat:
MMakefile | 8++++----
Abin/io-find | 6++++++
Abin/io-fstab | 9+++++++++
Abin/io-man | 7+++++++
Abin/io-mblaze | 20++++++++++++++++++++
Abin/io-net | 4++++
Abin/io-passwd | 9+++++++++
Abin/io-ps | 9+++++++++
8 files changed, 68 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -29,7 +29,7 @@ clean: .PHONY: install install: iomenu - mkdir -p ${PREFIX}/share/man/man1 - cp *.1 ${PREFIX}/share/man/man1 - mkdir -p ${PREFIX}/bin - cp iomenu ${PREFIX}/bin + mkdir -p ${PREFIX}/share/man/man1 + cp *.1 ${PREFIX}/share/man/man1 + mkdir -p ${PREFIX}/bin + cp iomenu bin/* ${PREFIX}/bin diff --git a/bin/io-find b/bin/io-find @@ -0,0 +1,6 @@ +#!/bin/sh -e +# find a file from current directory with iomenu + +test $# = 0 && set -- . + +find "$@" '(' -name .git -o -name CVS ')' -prune -o -print | sort | iomenu diff --git a/bin/io-fstab b/bin/io-fstab @@ -0,0 +1,9 @@ +#!/bin/sh -e +# display mounts and fstab in iomenu + +{ + printf '#/etc/fstab\n' + column -ts ' ' </etc/fstab + printf '#mount\n' + mount | column -ts ' ' +} | iomenu -# diff --git a/bin/io-man b/bin/io-man @@ -0,0 +1,7 @@ +#!/bin/sh -e +# man page picker with iomenu + +man -k ' ' | sed -r ' + s/ - / - / + s/(.{25}[^ ]* ) * - /\1- / +' | iomenu | sed -r 's,[(,].*,,' | xargs man diff --git a/bin/io-mblaze b/bin/io-mblaze @@ -0,0 +1,20 @@ +#!/bin/sh -e +# mail client using iomenu, mblaze, to be used with mfilter + +cd /home/mail + +if test "$1" = -a +then IFS=' ' read dir mail <<EOF +$(iomenu -'#' <index) +EOF + mseq -S <$dir/seq >/dev/null + exec mless "$(echo $mail | sed -r 's, *([0-9]+).*,\1,') +fi + +wc -l */seq | sed 's, 0, .,; s,/seq$,,' | + iomenu | sed -r 's,^ +[^ ]+ +,,' | + xargs printf %s/%s "$(pwd)" | mlist | msort -r -d | mseq -S + +mscan -f '%6n %u %D %20f %t%2i%120S' | + iomenu | sed -r 's,^ *([0-9]*) .*,\1,' | + xargs mless diff --git a/bin/io-net b/bin/io-net @@ -0,0 +1,4 @@ +#!/bin/sh -e +# searchable netstat results with iomenu + +netstat "$@" | sed 's/^[AP]/#&/' | iomenu -'#' diff --git a/bin/io-passwd b/bin/io-passwd @@ -0,0 +1,9 @@ +#!/bin/sh -e +# display /etc/passwd and /etc/group in iomenu + +{ + printf '#/etc/passwd\n' + column -ts : < /etc/passwd + printf '#/etc/group\n' + column -ts : < /etc/group +} | iomenu -'#' diff --git a/bin/io-ps b/bin/io-ps @@ -0,0 +1,9 @@ +#!/bin/sh -e +# process list picker with iomenu + +ps='ps -o pid,user,stat,args' + +{ + printf '#' + ps "$@" +} | iomenu -'#' | sed -r 's/[^ ]* *([0-9]*).*/\1/'