From e3d11b3e7c07b0f8b5f90aeee8d0971e0a83edbf Mon Sep 17 00:00:00 2001 From: Andrew Weaver Date: Tue, 9 May 2017 11:45:28 -0400 Subject: [PATCH] add query for default browser --- scripts/ffmprovisr | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/ffmprovisr b/scripts/ffmprovisr index f91dff2..17c3976 100755 --- a/scripts/ffmprovisr +++ b/scripts/ffmprovisr @@ -1,13 +1,18 @@ #!/usr/bin/env bash if [[ $OSTYPE = darwin* ]] ; then + default_browser=$(plutil -convert json ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist -r -o - | grep https -b1 | tail -n1 | cut -d'"' -f4) if [ -d /usr/local/Cellar/ffmprovisr ] ; then ffmprovisr_path=$(find /usr/local/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1) fi if [ -z "${ffmprovisr_path}" ] ; then ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/' fi - open "${ffmprovisr_path}" + if [ -n "${default_browser}" ] ; then + open -b "${default_browser}" "${ffmprovisr_path}" + else + open "${ffmprovisr_path}" + fi elif [[ $OSTYPE = linux-gnu ]] ; then if [ -d ~/.linuxbrew/Cellar/ffmprovisr ] ; then ffmprovisr_path=$(find ~/.linuxbrew/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1)