From ca4515d440d365f4f6cb5470ad6f22df0404b545 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Thu, 25 Jul 2024 01:53:02 -0500 Subject: [PATCH] rework the regeneration mechanism for tmenu_run --- builds/utils/tmenu_run | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/builds/utils/tmenu_run b/builds/utils/tmenu_run index dfa4131..544dfd1 100755 --- a/builds/utils/tmenu_run +++ b/builds/utils/tmenu_run @@ -9,12 +9,11 @@ tmenu_path () { done } -if [ "$(basename $0)" = "regenerate" ]; then +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 > $HOME/.local/share/tmenu_cache - xmessage "regeneration complete" - exit + tmenu_path | sort > $HOME/.local/share/tmenu_cache else - export IS_RUNNING_IN_TMENU="yes" - cat $HOME/.local/share/tmenu_cache | tmenu | ${SHELL:-"/bin/sh"} & + /bin/sh -c $choice & fi