From 79814a4c9f765cb789551aa516bc5bc605a7def9 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 23 Mar 2009 22:25:41 +0100 Subject: More filetypes for dircolors and suffix aliases --- include/mimetypes | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 include/mimetypes (limited to 'include') diff --git a/include/mimetypes b/include/mimetypes new file mode 100755 index 0000000..5a7f92b --- /dev/null +++ b/include/mimetypes @@ -0,0 +1,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)" -- cgit v1.2.3