Last active
December 15, 2015 11:38
-
-
Save brunogama/5254021 to your computer and use it in GitHub Desktop.
This Gist is for all who want to know the User's default browser using the Mac Terminal.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Author: Bruno Gama | |
echo $(basename "$(mdfind "kMDItemCFBundleIdentifier == '$(/usr/bin/plutil -convert xml1 -o - ~/Library/Preferences/com.apple.LaunchServices.plist | grep -B 3 "<string>http</string>" | tail -3 | head -n1 | sed -e 's/<[^>]*>//g' | sed 's/[[:space:]]//g' | tr -d '\040\010\012\015')'cd")" | sed s'/.app$//') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment