-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-uti-handlers.sh
executable file
·35 lines (28 loc) · 1.13 KB
/
setup-uti-handlers.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
#
# https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html
#
# Get app ID: osascript -e 'id of app "$appName"'
if ! builtin type -P "duti" &> /dev/null; then
echo "This script requires duti (see https://github.com/moretension/duti)."
echo "It can be installed with brew install duti."
exit 1
fi
echo "duti tool available. Setting up handler..."
videoPlayer="io.mpv"
echo " video player $videoPlayer"
duti -s "$videoPlayer" org.webmproject.webm all
duti -s "$videoPlayer" public.mpeg-4 all
duti -s "$videoPlayer" public.mpeg all
duti -s "$videoPlayer" public.avi all
duti -s "$videoPlayer" com.apple.quicktime-movie all
duti -s "$videoPlayer" com.apple.m4v-video all
duti -s "$videoPlayer" com.microsoft.windows-media-wmv all
duti -s "$videoPlayer" public.movie all
audioPlayer="com.kv.Aural"
echo " audio player $audioPlayer"
duti -s "$audioPlayer" public.mp3 all
duti -s "$audioPlayer" public.mpeg-4-audio all
duti -s "$audioPlayer" public.aiff-audio all
duti -s "$audioPlayer" public.aac-audio all
duti -s "$audioPlayer" public.audio all