make regeneration of tmenu_run cache better

This commit is contained in:
stupidcomputer 2024-11-03 23:41:14 -06:00
parent 287d092972
commit d0f532f15c
2 changed files with 2 additions and 3 deletions

View File

@ -38,7 +38,6 @@ stdenv.mkDerivation rec {
for i in $(ls $src/); do
cp $src/$i $out/bin
ln -sf $out/bin/tmenu_run $out/bin/regenerate
wrapProgram $out/bin/$i --prefix PATH : ${lib.makeBinPath [ sxhkd bash feh xrandr jq figlet curl fzy xkbset ytfzf sshuttle svkbd scrcpy xrectsel ffcast xmessage imagemagick ]}
done
'';

View File

@ -10,8 +10,8 @@ tmenu_path () {
}
export IS_RUNNING_IN_TMENU="yes"
choice=$(cat $HOME/.local/share/tmenu_cache | tmenu)
if [ -z "$choice" ]; then
choice=$(echo regenerate | cat $HOME/.local/share/tmenu_cache - | tmenu)
if [ "$choice" = "regenerate" ]; then
mkdir -p $HOME/.local/share
tmenu_path | sort > $HOME/.local/share/tmenu_cache
else