dot_testing/builds/utils/tmenu_run

20 lines
417 B
Bash
Executable File

#!/bin/sh
tmenu_path () {
IFS=" :"
for i in $PATH; do
for j in "$i"/*; do
[ -f "$j" ] && [ -x "$j" ] && printf "%s\n" "$j" | xargs basename
done
done
}
export IS_RUNNING_IN_TMENU="yes"
choice=$(cat $HOME/.local/share/tmenu_cache | tmenu)
if [ -z "$choice" ]; then
mkdir -p $HOME/.local/share
tmenu_path | sort > $HOME/.local/share/tmenu_cache
else
/bin/sh -c $choice &
fi