add tmenu

This commit is contained in:
randomuser 2022-07-05 14:08:31 -05:00
parent f18f974a35
commit dcaa5e0f03
4 changed files with 29 additions and 0 deletions

View File

@ -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

8
sh/tmenu Executable file
View File

@ -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"

6
sh/tmenu-backend Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
printf "%s" $1
fzy < "$1" > "${1}a"
mv ${1}a ${1}

12
sh/tmenu_run Executable file
View File

@ -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"} &