mew

fork with password patch and nord colorscheme
git clone https://git.awy.one/mew.git
Log | Files | Refs | README | LICENSE

mew-run (499B)


      1 #!/bin/sh
      2 
      3 cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
      4 cache="$cachedir/mew_run"
      5 
      6 [ -d "$cachedir" ] || mkdir -p "$cachedir"
      7 
      8 uptodate() {
      9 	[ -f "$cache" ] || return 1
     10 	IFS=:
     11 	for path in $PATH; do
     12 		# non-POSIX
     13 		test "$path" -nt "$cache" && return 1
     14 	done
     15 	return 0
     16 }
     17 
     18 bins() {
     19 	IFS=:
     20 	for path in $PATH; do
     21 		for bin in "$path"/*; do
     22 			[ -x "$bin" ] && echo "${bin##*/}"
     23 		done
     24 	done
     25 }
     26 
     27 path() {
     28 	if uptodate; then
     29 		cat "$cache"
     30 	else
     31 		bins | sort -u | tee "$cache"
     32 	fi
     33 }
     34 
     35 path | mew -e "$@"