2022-07-05 14:08:31 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
tmenu_path () {
|
|
|
|
IFS=" :"
|
|
|
|
for i in $PATH; do
|
|
|
|
for j in "$i"/*; do
|
2023-01-31 11:26:27 -06:00
|
|
|
[ -f "$j" ] && [ -x "$j" ] && printf "%s\n" "$j" | xargs basename
|
2022-07-05 14:08:31 -05:00
|
|
|
done
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2024-07-25 01:53:02 -05:00
|
|
|
export IS_RUNNING_IN_TMENU="yes"
|
|
|
|
choice=$(cat $HOME/.local/share/tmenu_cache | tmenu)
|
|
|
|
if [ -z "$choice" ]; then
|
2023-01-31 11:26:27 -06:00
|
|
|
mkdir -p $HOME/.local/share
|
2024-07-25 01:53:02 -05:00
|
|
|
tmenu_path | sort > $HOME/.local/share/tmenu_cache
|
2023-01-31 11:26:27 -06:00
|
|
|
else
|
2024-07-25 01:53:02 -05:00
|
|
|
/bin/sh -c $choice &
|
2023-01-31 11:26:27 -06:00
|
|
|
fi
|