mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
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)
This commit is contained in:
parent
c0ed6fd8a1
commit
3e543e6b11
1 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue