rework the regeneration mechanism for tmenu_run

This commit is contained in:
stupidcomputer 2024-07-25 01:53:02 -05:00
parent 8ed9beffba
commit ca4515d440
1 changed files with 5 additions and 6 deletions

View File

@ -9,12 +9,11 @@ tmenu_path () {
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"} &
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