X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=bin%2Fbin%2Fpe;fp=bin%2Fbin%2Fpe;h=8b64702a77f53de9de5150d9b83fc684eafd66dd;hb=3d5975f24c8913da9d903b94c5beeacd2e9846e1;hp=0000000000000000000000000000000000000000;hpb=62bccf2a97581ed475dd46068621d0dffa21d5c9;p=dotfiles.git diff --git a/bin/bin/pe b/bin/bin/pe new file mode 100755 index 0000000..8b64702 --- /dev/null +++ b/bin/bin/pe @@ -0,0 +1,29 @@ +#!/bin/zsh + +exec >&2 +fns=() +toprint=() +typeset -A seen +ctr=0 +path-extractor | while read fn ; do + [[ $seen[$fn] -eq 1 ]] && continue + seen+=($fn 1) + fns+=($fn) + toprint+=(`printf "%X:%s" $ctr "${fn}"`) + ctr=$(( $ctr + 1 )) +done +[[ $ctr -le 20 ]] && print -C 1 $toprint || print -c $toprint +print -n "> " +read choice < /dev/tty +[[ "$choice" = "q" ]] && exit +if [[ "$choice" = "*" ]]; then + buf=$fns +else + buf=() + for c in ${=choice} ; do + fn=$fns[$(( 1 + 16#$c ))] + buf+=($fn) + done +fi +print $buf +print -n $buf | xclip -in -selection clipboard