From 41e2e31f6ac58a2c20d0507fd9a14590255f38d3 Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Sun, 7 Jun 2020 20:44:03 -0500 Subject: [PATCH] Fix bug with files script --- scripts/appscripts/sxmo_files.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/appscripts/sxmo_files.sh b/scripts/appscripts/sxmo_files.sh index a58bd82..1f5c693 100755 --- a/scripts/appscripts/sxmo_files.sh +++ b/scripts/appscripts/sxmo_files.sh @@ -3,9 +3,14 @@ EDITOR=vis cd "/home/$USER/" || exit 1 handlefiles() { - echo "$1" | grep -iE ".(wav|webm|mp4|ogg|opus|m4a|flac|mov|avi)$" && st -e mpv "$@" && exit - echo "$1" | grep -iE ".(jpg|png|gif)$" && st -e sxiv "$@" && exit - st -e sh -ic "$EDITOR $*" && exit + if echo "$1" | grep -iE ".(wav|webm|mp4|ogg|opus|m4a|flac|mov|avi)$"; then + st -e mpv "$@" + elif echo "$1" | grep -iE ".(jpg|png|gif)$"; then + st -e sxiv "$@" + else + st -e sh -ic "$EDITOR $*" + fi + exit 0 } while true; do