rework the regeneration mechanism for tmenu_run
This commit is contained in:
parent
8ed9beffba
commit
ca4515d440
|
@ -9,12 +9,11 @@ tmenu_path () {
|
||||||
done
|
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"
|
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
|
fi
|
||||||
|
|
Loading…
Reference in New Issue