From 3e543e6b11e67e83b3478e85d13e5b8667dc9af8 Mon Sep 17 00:00:00 2001 From: Joss Brown Date: Thu, 12 Oct 2017 14:53:15 +0200 Subject: [PATCH] Update ytview (#127) added: (1.a) `mpv` (command) ; (1.b) MPV (.app) ; (2) $HOME/Applications directory path for both VLC & mpv (should actually be the default Applications directory for drag & drop installations) --- ytview/ytview | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ytview/ytview b/ytview/ytview index b332402..848ad01 100755 --- a/ytview/ytview +++ b/ytview/ytview @@ -91,7 +91,7 @@ getConfiguredPlayer() if [[ $(uname -s) == "Linux" ]]; then if command -v vlc &>/dev/null; then player="vlc" - elif command -v mpv &>/dev/null; then + elif command -v mpv &>/dev/null; then player="mpv" elif command -v mplayer &>/dev/null; then player="mplayer" @@ -102,11 +102,20 @@ getConfiguredPlayer() elif [[ $(uname -s) == "Darwin" ]]; then if [[ -f /Applications/VLC.app/Contents/MacOS/VLC ]]; then player="/Applications/VLC.app/Contents/MacOS/VLC" + elif [[ -f $HOME/Applications/VLC.app/Contents/MacOS/VLC ]]; then + player="$HOME/Applications/VLC.app/Contents/MacOS/VLC" + elif command -v mpv &>/dev/null; then + player="mpv" + elif [[ -f /Applications/mpv.app/Contents/MacOS/mpv ]]; then + player="/Applications/mpv.app/Contents/MacOS/mpv" + elif [[ -f $HOME/Applications/mpv.app/Contents/MacOS/mpv ]]; then + player="$HOME/Applications/mpv.app/Contents/MacOS/mpv" else - echo "Error: vlc is not installed and it is required to play videos" >&2 + echo "Error: no supported video player installed (vlc or mpv)" >&2 return 1 fi fi + fi } # Get the video titles