fix '#' prefix

This commit is contained in:
speedie 2023-04-28 18:07:58 +02:00
parent da6ee13a30
commit 24ea28eb13

View file

@ -266,17 +266,21 @@ parse() {
sout="$(path | sed "s/\&/\&/g" | $RUNLAUNCHER "${rl_run[@]}")"
# parse
case "$(printf '%c' "$sout" >&2)" in
case "${sout:0:1}" in
"#") EXEC="term" ;;
"?") EXEC="man" ;;
esac
printf "Run launcher output: '%s'\n" "$sout" >> "$LOGFILE"
case "$(printf "%s" "$sout" | awk '{ print $1 }')" in
"magnet") EXEC=torrent ;;
"www") EXEC=web ;;
"?") print_help "$@" && parse && exec_cmd ;;
esac
printf "Type: '%s'\n" "$EXEC" >> "$LOGFILE"
# check for keywords
printf "%s" "$sout" | grep -qE "$WEB_GREP" && EXEC=web
printf "%s" "$sout" | grep -qE "$MAGNET_GREP" && EXEC=torrent
@ -610,6 +614,7 @@ cache_desktop() {
main() {
[ -d "/System/Library/Extensions" ] && fail_mac "$@"
rm -f "$LOGFILE"
print_config
read_args "$@"
check "$args"