files: play audio files with mpv no-vid and add mp3 support

Signed-off-by: Miles Alan <m@milesalan.com>
This commit is contained in:
Anjandev Momi 2020-06-08 01:46:11 -07:00 committed by Miles Alan
parent 41e2e31f6a
commit 3c65a36fd2

View file

@ -3,8 +3,10 @@ EDITOR=vis
cd "/home/$USER/" || exit 1
handlefiles() {
if echo "$1" | grep -iE ".(wav|webm|mp4|ogg|opus|m4a|flac|mov|avi)$"; then
if echo "$1" | grep -iE ".(webm|ogg|mp4|mov|avi)$"; then
st -e mpv "$@"
elif echo "$1" | grep -iE ".(wav|opus|m4a|flac|mp3)$"; then
st -e mpv --vid=no -v "$@"
elif echo "$1" | grep -iE ".(jpg|png|gif)$"; then
st -e sxiv "$@"
else