diff --git a/Makefile b/Makefile index ea90499..8c15632 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,9 @@ sh: cp -f sh/fire $(DESTDIR)$(PREFIX)/bin cp -f sh/pash-dmenu $(DESTDIR)$(PREFIX)/bin cp -f sh/pash-dmenu-backend $(DESTDIR)$(PREFIX)/bin + cp -f sh/tmenu $(DESTDIR)$(PREFIX)/bin + cp -f sh/tmenu-backend $(DESTDIR)$(PREFIX)/bin + cp -f sh/tmenu_run $(DESTDIR)$(PREFIX)/bin mkc: c/scream c/timer c/boid c/anaconda c/colors diff --git a/sh/tmenu b/sh/tmenu new file mode 100755 index 0000000..cbfeec6 --- /dev/null +++ b/sh/tmenu @@ -0,0 +1,8 @@ +#!/bin/sh + +file=$(mktemp) +cat - > "$file" + +st -c tmenu-prompt -g 40x10+0+0 -e tmenu-backend "$file" +cat "$file" +rm "$file" diff --git a/sh/tmenu-backend b/sh/tmenu-backend new file mode 100755 index 0000000..cd2839b --- /dev/null +++ b/sh/tmenu-backend @@ -0,0 +1,6 @@ +#!/bin/sh + +printf "%s" $1 + +fzy < "$1" > "${1}a" +mv ${1}a ${1} diff --git a/sh/tmenu_run b/sh/tmenu_run new file mode 100755 index 0000000..1b57921 --- /dev/null +++ b/sh/tmenu_run @@ -0,0 +1,12 @@ +#!/bin/sh + +tmenu_path () { + IFS=" :" + for i in $PATH; do + for j in "$i"/*; do + [ -f $j ] && [ -x $j ] && printf "%s\n" $j + done + done +} + +tmenu_path | tmenu "$@" | ${SHELL:-"/bin/sh"} &