From d0f532f15c91c3e6af6b36ce2fd6c8fcce782189 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Sun, 3 Nov 2024 23:41:14 -0600 Subject: [PATCH] make regeneration of tmenu_run cache better --- builds/utils.nix | 1 - builds/utils/tmenu_run | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/builds/utils.nix b/builds/utils.nix index 4547fe5..a749a8e 100644 --- a/builds/utils.nix +++ b/builds/utils.nix @@ -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 ''; diff --git a/builds/utils/tmenu_run b/builds/utils/tmenu_run index 544dfd1..1039ea9 100755 --- a/builds/utils/tmenu_run +++ b/builds/utils/tmenu_run @@ -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