synthing still used hardcoded BSD path, swith to dynamic searches.
always use `head -1` with which due to non-portability.
use $HOME instead of ~ to avoid non-portability.
#!/bin/sh
-exec `which -a dmenu | grep -iv ~ | head -1` -b -f -fn 'monospace-10' -nb \#110800 -nf \#93a1a1 -sb \#aa5500 -sf \#eee8d5 "$@"
+exec $(which -a dmenu | grep -v "$HOME" | head -1) -b -f -fn 'monospace-10' -nb \#110800 -nf \#93a1a1 -sb \#aa5500 -sf \#eee8d5 "$@"
#!/bin/sh
umask 007
-/usr/local/bin/syncthing -logfile="$HOME/var/log/syncthing.log"
+$(which -a syncthing | grep -v "$HOME" | head -1) -logfile="$HOME/var/log/syncthing.log"
trap "echoerr 'Failed to install!'" ERR >/dev/null 2>&1 #can't trap ERR in sh
# Check requirements for native messenger
-python_path=$(which python3) || python_path=""
+python_path=$(which python3 | head -1) || python_path=""
if [ ! -x "$python_path" ]; then
echoerr "Error: Python 3 must exist in PATH."
echoerr "Please install it and run this script again."