dot_testing/builds/utils/tmenu_run

21 lines
463 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
}
if [ "$(basename $0)" = "regenerate" ]; then
mkdir -p $HOME/.local/share
tmenu_path > $HOME/.local/share/tmenu_cache
xmessage "regeneration complete"
exit
else
export IS_RUNNING_IN_TMENU="yes"
cat $HOME/.local/share/tmenu_cache | tmenu | ${SHELL:-"/bin/sh"} &
fi