blob: 5a7f92b88145802f12fabf10c13cc260bbfc8329 (
plain)
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
|
#!/usr/bin/env zsh
typeset -a audio video image
typeset c_audio='04;36' c_video='04;32' c_image='04;33'
while read mime extensions; do
[[ $mime == audio/* ]] && audio+=(${(s/ /)extensions})
[[ $mime == video/* ]] && video+=(${(s/ /)extensions})
[[ $mime == image/* ]] && image+=(${(s/ /)extensions})
done < /etc/mime.types
audio=(${(i)audio})
video=(${(i)video})
image=(${(i)image})
echo "## dircolors"
echo "# audio"
for type in $audio; {
echo ".$type $c_audio"
}
echo "\n# video"
for type in $video; {
echo ".$type $c_video"
}
echo "\n# images"
for type in $image; {
echo ".$type $c_image"
}
echo "\n\n## suffix aliases"
echo "audio_formats=($audio)"
echo "video_formats=($video)"
echo "image_formats=($image)"
|