Fork urlhandler program if run with fork option and pass opt in RSS script

This commit is contained in:
Miles Alan 2020-07-09 18:22:30 -05:00
parent fe15eb6755
commit 7a9ec120e1
2 changed files with 8 additions and 2 deletions

View file

@ -65,5 +65,5 @@ while true; do
# Handle picked item
URL="$(echo "$PICKED" | gawk -F " " '{print $NF}')"
sxmo_urlhandler.sh "$URL"
sxmo_urlhandler.sh "$URL" fork
done

View file

@ -1,4 +1,5 @@
#!/usr/bin/env sh
FORK="$2"
if [ -n "$1" ]
then
@ -40,4 +41,9 @@ COMMAND=$(
[ -z "$COMMAND" ] && exit 1
RUN=$(echo "$URL" | xargs -IURL echo "$COMMAND")
st -e sh -c "$RUN"
if [ "$FORK" = fork ]; then
st -e sh -c "$RUN" &
else
st -e sh -c "$RUN"
fi