dot

packages and services management
Log | Files | Refs | README

commit 8505f7104931589167ff4445e96297b4b2eccc08
parent cf361439e8dbdb3b95dd71b887b5900923499ec3
Author: josuah <mail@josuah.net>
Date:   Fri, 21 Oct 2016 19:08:26 -0400

Added iomenu

Diffstat:
ABUILD/iomenu | 3+++
Mbin/bkm | 4++--
Mbin/buffers | 12++++++------
Mbin/complete | 15++++++---------
Mbin/feeds | 4++--
Mbin/music | 2+-
Dbin/swiper | 22----------------------
Mshell/.profile | 6+++---
Mtmux/.config/tmux/new-session | 2+-
9 files changed, 24 insertions(+), 46 deletions(-)

diff --git a/BUILD/iomenu b/BUILD/iomenu @@ -0,0 +1,3 @@ +# Input/Output interactive menu and completion engine. + +tar=http://github.com/josuah/iomenu/archive/master.tar.gz diff --git a/bin/bkm b/bin/bkm @@ -9,7 +9,7 @@ BOOKMARKS="${BKM:-$XDG_CACHE_HOME/bkm/bkm}" if [ "$#" -eq 0 ] then - url="$(fzf < $BOOKMARKS)" + url="$(iomenu < $BOOKMARKS)" [ "${url##* }" ] && TERM=screen $BROWSER "${url##* }" printf '\n\n\n\n\n\n\n' @@ -19,7 +19,7 @@ fi printf 'url: '; read url printf 'description: '; read description tag="$( - sed -r 's/^([^ ]*).*/\1/' "$BOOKMARKS" | uniq | fzf | tr '[a-z]' '[A-Z]' + sed -r 's/^([^ ]*).*/\1/' "$BOOKMARKS" | uniq | iomenu | tr '[a-z]' '[A-Z]' )" printf '%s %s %s\n' "$tag" "$description" "$url" >> "$BOOKMARKS" diff --git a/bin/buffers b/bin/buffers @@ -5,7 +5,7 @@ #------------------------------------------------------------------------------- # Run commands in detachable buffers -# External: stest (dmenu), fzy, abduco +# External: stest (dmenu), iomenu, abduco # Busybox: mkdir, tee, sort, clear, tr, sed help=' @@ -45,7 +45,7 @@ run() stest -flx $PATH | sort -u | tee "$cache" else tee < "$cache" - fi | fzy + fi | iomenu )" # Get command arguments and the session name @@ -79,14 +79,14 @@ run() # Single-buffer editor vi | vis | less | ex-vi | ex | ed ) - path="$(find . -type f ! -path '*/.git/*' | fzy)" + path="$(find . -type f ! -path '*/.git/*' | sed 's/.\///' | iomenu)" [ -z "$path" ] && exit 1 ;; # Multi-buffer editor vim ) - path="$(find . -type d ! -path '*/.git/*' ! -name .git | fzy)" + path="$(find . -type d ! -path '*/.git/*' ! -name .git | sed 's/.\///' | iomenu)" cd "$path" [ -z "$path" ] && exit 0 @@ -98,7 +98,7 @@ run() if [ -z "${opt##*\**}" -a "$opt" ] then - path="$(find . -type f | fzy)" + path="$(find . -type f ! -path '*/.git/*' | sed 's/.\///' | iomenu)" opt="${opt##*\*} $path ${opt%%\**}" [ -z "$path" ] && exit 1 @@ -132,7 +132,7 @@ attach() printf '\033[1A' # Get the session name by prompting the user. - name="$(abduco | sed 1d | sort -k 4 | tr ! / | fzy | tr / !)" + name="$(abduco | sed 1d | sort -k 4 | tr ! / | iomenu | tr / !)" name="${name##*$TAB}" # Set the name of the terminal. diff --git a/bin/complete b/bin/complete @@ -6,14 +6,11 @@ # Complete string with a word from a file. help=' -NAME - Complete - complete word or line from stdin with candidates from a file -USAGE - complete OPTION FILE +Usage: complete OPTION FILE + +FILE + file to search candidates from -DESCRIPTION - STDIN part to match from the words, and to remove from the candidates. - FILE file to search candidates from OPTION -w complete by word -l complete by line @@ -38,12 +35,12 @@ case "$ACTION" in -w ) sed 's/[[:space:]]/\n/g' "$file" | sort -u | while read word do [ -z "${word##$prefix*}" ] && printf '%s\n' "$word" - done | fzf | { + done | iomenu | { IFS="$NL" read -r word printf '%s\n' "$word" } ;; -l ) - fzf -q "$prefix" < "$file" + iomenu < "$file" ;; esac diff --git a/bin/feeds b/bin/feeds @@ -167,9 +167,9 @@ view() sort -ro "$tempfile" "$tempfile" selection="$(cat "$CACHE/$(cat "$tempfile" \ - | fzf \ + | iomenu \ | sed 's/ *[0-9]* //')" \ - | fzf \ + | iomenu \ | awk '{ print $NF }')" rm "$tempfile" diff --git a/bin/music b/bin/music @@ -8,7 +8,7 @@ cd "$HOME/Music" while : -do find . -mindepth 1 -type f -follow | sed 's/^.\///' | fzf | { +do find . -mindepth 1 -type f -follow | sed 's/^.\///' | iomenu | { read track [ "$track" ] && mplayer "$track" } diff --git a/bin/swiper b/bin/swiper @@ -1,22 +0,0 @@ -# * -# ,--- , , , , ---. ,--. .,-- -# `--. | | | | | | |--' | -# ---' `-'-' ' |--' `--' ' 2016-10-08 -#--------------|---------------------------------------------------------------- -# A search with an overview. Oh, man! - -FILTER="${FILTER:-fzf-tmux}" -i=0 - -[ ! -f $1 ] && printf 'USAGE:\tswiper [file]\n' - -{ - [ "$1" ] && tee < $1 || tee -} | while IFS= read -r line -do - i=$(($i + 1)) - printf '%6s %s\n' "$i" "$line" -done | $FILTER | { - read -r number line - printf '%s\n' "$number" -} diff --git a/shell/.profile b/shell/.profile @@ -101,9 +101,9 @@ alias a='buffers attach' alias r='buffers run' alias v='buffers run $VISUAL' alias t='tmux attach &>/dev/null || tmux new' -alias f='find . -type f ! -path "*/.git/*" | fzy' -alias d='find . -type d ! -path "*/.git/*" | fzy' -alias c='cd "$(find . -maxdepth 4 -mindepth 1 -type d | fzy)"' +alias f='find . -type f ! -path "*/.git/*" | iomenu' +alias d='find . -type d ! -path "*/.git/*" | iomenu' +alias c='cd "$(find . -maxdepth 4 -mindepth 1 -type d | iomenu)"' alias g='grep --color=always' alias myip='curl icanhazip.com' alias lines='find . -name "*.[ch]" | xargs wc -l' diff --git a/tmux/.config/tmux/new-session b/tmux/.config/tmux/new-session @@ -8,7 +8,7 @@ dir="$( find "$HOME/" -maxdepth 3 ! -path '*/.*' -type d | while read line do printf '%s\n' "~${line#$HOME}" - done | fzf --margin=3,6 + done | iomenu )" cd "$HOME${dir#\~}"