Last active
October 6, 2022 18:25
-
-
Save Superbil/860b906fa3370a55201a73d2b6396dd9 to your computer and use it in GitHub Desktop.
Update default videos to open by player
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 zsh | |
## Update exts | |
# Author: Superbil | |
# website: https://gist.github.com/Superbil/860b906fa3370a55201a73d2b6396dd9 | |
# Use duti to setup player | |
# | |
# Usage update_exts.sh <bundle_id> | |
# | |
# Check argv | |
if [ $# -eq 0 ]; then | |
echo "No arguments supplied, setup player bundle_id" | |
exit 1 | |
fi | |
if [ -z "$1" ]; then | |
echo "Input bundle_id is emptry string" | |
exit 1 | |
fi | |
PLAYER_BUNDLE_ID=$1 | |
EXTS=( 3GP ASF AVI FLV M4V MKV MOV MP4 MPEG MPG MPG2 MPG4 RMVB WMV MTS WEBM ) | |
if (( $+commands[duti] )); then | |
for ext in ${EXTS[@]} | |
do | |
duti -vs $PLAYER_BUNDLE_ID $ext all | |
duti -vs $PLAYER_BUNDLE_ID $(echo $ext | tr "[:upper:]" "[:lower:]") all | |
done | |
else | |
echo "duti not install!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
old version https://github.com/Superbil/dotfiles/blob/master/mpv/.config/mpv/update_exts.sh
IINA bundle ID com.colliderli.iina
mpv bundle ID io.mpv