From 4d3b50949361c9725bab7b5dd07b592b11e5a120 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 9 Aug 2015 02:47:13 +0200 Subject: added gvim symbol and added generation script for mime type symbols (Makefile included) --- scalable/apps/gvim.png | Bin 0 -> 263087 bytes scalable/mimetypes/templates/Makefile | 3 + .../templates/default/application-x-executable.png | Bin 0 -> 194302 bytes .../templates/default/application-xml-dtd.png | Bin 0 -> 238889 bytes .../mimetypes/templates/default/application.png | Bin 0 -> 161557 bytes scalable/mimetypes/templates/default/audio.png | Bin 0 -> 132002 bytes scalable/mimetypes/templates/default/file.png | Bin 0 -> 166650 bytes scalable/mimetypes/templates/default/image.png | Bin 0 -> 166650 bytes scalable/mimetypes/templates/default/text-css.png | Bin 0 -> 165568 bytes .../mimetypes/templates/default/text-x-chdr.png | Bin 0 -> 270482 bytes .../mimetypes/templates/default/text-x-csrc.png | Bin 0 -> 270303 bytes .../mimetypes/templates/default/text-x-generic.png | Bin 0 -> 166650 bytes .../templates/default/text-x-makefile.png | Bin 0 -> 137102 bytes .../mimetypes/templates/default/text-x-script.png | Bin 0 -> 267918 bytes scalable/mimetypes/templates/default/text.png | Bin 0 -> 107109 bytes scalable/mimetypes/templates/default/video.png | Bin 0 -> 136691 bytes scalable/mimetypes/templates/generate.sh | 63 +++++++++++++++++++++ scalable/mimetypes/templates/test-globs | 4 ++ 18 files changed, 70 insertions(+) create mode 100644 scalable/apps/gvim.png create mode 100644 scalable/mimetypes/templates/Makefile create mode 100644 scalable/mimetypes/templates/default/application-x-executable.png create mode 100644 scalable/mimetypes/templates/default/application-xml-dtd.png create mode 100644 scalable/mimetypes/templates/default/application.png create mode 100644 scalable/mimetypes/templates/default/audio.png create mode 100644 scalable/mimetypes/templates/default/file.png create mode 100644 scalable/mimetypes/templates/default/image.png create mode 100644 scalable/mimetypes/templates/default/text-css.png create mode 100644 scalable/mimetypes/templates/default/text-x-chdr.png create mode 100644 scalable/mimetypes/templates/default/text-x-csrc.png create mode 100644 scalable/mimetypes/templates/default/text-x-generic.png create mode 100644 scalable/mimetypes/templates/default/text-x-makefile.png create mode 100644 scalable/mimetypes/templates/default/text-x-script.png create mode 100644 scalable/mimetypes/templates/default/text.png create mode 100644 scalable/mimetypes/templates/default/video.png create mode 100755 scalable/mimetypes/templates/generate.sh create mode 100644 scalable/mimetypes/templates/test-globs (limited to 'scalable') diff --git a/scalable/apps/gvim.png b/scalable/apps/gvim.png new file mode 100644 index 0000000..441691b Binary files /dev/null and b/scalable/apps/gvim.png differ diff --git a/scalable/mimetypes/templates/Makefile b/scalable/mimetypes/templates/Makefile new file mode 100644 index 0000000..f9ca85b --- /dev/null +++ b/scalable/mimetypes/templates/Makefile @@ -0,0 +1,3 @@ +all: + ./generate.sh /usr/share/mime/generic-icons + ./generate.sh /usr/share/mime/globs diff --git a/scalable/mimetypes/templates/default/application-x-executable.png b/scalable/mimetypes/templates/default/application-x-executable.png new file mode 100644 index 0000000..92c5515 Binary files /dev/null and b/scalable/mimetypes/templates/default/application-x-executable.png differ diff --git a/scalable/mimetypes/templates/default/application-xml-dtd.png b/scalable/mimetypes/templates/default/application-xml-dtd.png new file mode 100644 index 0000000..6e75df0 Binary files /dev/null and b/scalable/mimetypes/templates/default/application-xml-dtd.png differ diff --git a/scalable/mimetypes/templates/default/application.png b/scalable/mimetypes/templates/default/application.png new file mode 100644 index 0000000..78ee865 Binary files /dev/null and b/scalable/mimetypes/templates/default/application.png differ diff --git a/scalable/mimetypes/templates/default/audio.png b/scalable/mimetypes/templates/default/audio.png new file mode 100644 index 0000000..1271597 Binary files /dev/null and b/scalable/mimetypes/templates/default/audio.png differ diff --git a/scalable/mimetypes/templates/default/file.png b/scalable/mimetypes/templates/default/file.png new file mode 100644 index 0000000..69fd3ec Binary files /dev/null and b/scalable/mimetypes/templates/default/file.png differ diff --git a/scalable/mimetypes/templates/default/image.png b/scalable/mimetypes/templates/default/image.png new file mode 100644 index 0000000..69fd3ec Binary files /dev/null and b/scalable/mimetypes/templates/default/image.png differ diff --git a/scalable/mimetypes/templates/default/text-css.png b/scalable/mimetypes/templates/default/text-css.png new file mode 100644 index 0000000..64c2aa5 Binary files /dev/null and b/scalable/mimetypes/templates/default/text-css.png differ diff --git a/scalable/mimetypes/templates/default/text-x-chdr.png b/scalable/mimetypes/templates/default/text-x-chdr.png new file mode 100644 index 0000000..539f127 Binary files /dev/null and b/scalable/mimetypes/templates/default/text-x-chdr.png differ diff --git a/scalable/mimetypes/templates/default/text-x-csrc.png b/scalable/mimetypes/templates/default/text-x-csrc.png new file mode 100644 index 0000000..d55737a Binary files /dev/null and b/scalable/mimetypes/templates/default/text-x-csrc.png differ diff --git a/scalable/mimetypes/templates/default/text-x-generic.png b/scalable/mimetypes/templates/default/text-x-generic.png new file mode 100644 index 0000000..69fd3ec Binary files /dev/null and b/scalable/mimetypes/templates/default/text-x-generic.png differ diff --git a/scalable/mimetypes/templates/default/text-x-makefile.png b/scalable/mimetypes/templates/default/text-x-makefile.png new file mode 100644 index 0000000..bd48fd4 Binary files /dev/null and b/scalable/mimetypes/templates/default/text-x-makefile.png differ diff --git a/scalable/mimetypes/templates/default/text-x-script.png b/scalable/mimetypes/templates/default/text-x-script.png new file mode 100644 index 0000000..6eb0d88 Binary files /dev/null and b/scalable/mimetypes/templates/default/text-x-script.png differ diff --git a/scalable/mimetypes/templates/default/text.png b/scalable/mimetypes/templates/default/text.png new file mode 100644 index 0000000..7d7cb76 Binary files /dev/null and b/scalable/mimetypes/templates/default/text.png differ diff --git a/scalable/mimetypes/templates/default/video.png b/scalable/mimetypes/templates/default/video.png new file mode 100644 index 0000000..6527c94 Binary files /dev/null and b/scalable/mimetypes/templates/default/video.png differ diff --git a/scalable/mimetypes/templates/generate.sh b/scalable/mimetypes/templates/generate.sh new file mode 100755 index 0000000..be8de9c --- /dev/null +++ b/scalable/mimetypes/templates/generate.sh @@ -0,0 +1,63 @@ +DEFAULT_FILE='file' # .png gets added automatically +#INPUT_FILE=test-globs +#INPUT_FILE=/usr/share/mime/generic-icons < /usr/share/mime/globs +INPUT_FILE=$1 +OUT_PATH="../" + +MAX_LINES=`cat $INPUT_FILE | wc -l` +CUR_LINE=0 + +IFS=':' +while read A B +do + if [[ "$A" == "#"* ]]; then continue; fi + + MIME=$A + FILE=${A/\//-} + TEXT=${B/\*\./} + + + ((CUR_LINE++)) + printf "[%-4d/%-4d] checking for %s\n" "$CUR_LINE" "$MAX_LINES" "$FILE.png" + + if [[ -f "default/$FILE.png" ]]; then + echo "using default." + cp "default/$FILE.png" "$OUT_PATH/$FILE.png" + else + + FIND=$FILE + while [[ 1 ]] + do + # printf "%s\n" $FIND + if [[ -f "default/$FIND.png" ]]; then break; fi + + if [[ "$FIND" == "${FIND%-*}" ]]; then FIND="$DEFAULT_FILE"; break; fi + FIND=${FIND%-*} + done + + # create default file... just in case there is no desktop file... + cp "default/$FIND.png" "$OUT_PATH/$FILE.png" + + DESKTOP=`xdg-mime query default $MIME` + if [[ -f /usr/share/applications/$DESKTOP ]]; then + ICONTEXT=`grep -o 'Icon=.*' /usr/share/applications/$DESKTOP` + APPICON=`find ../../ /usr/share/icons/Adwaita/scalable /usr/share/icons/hicolor/scalable -path '*apps*' -name "${ICONTEXT/Icon=/}*" -type f -print -quit` + + printf "%-12s%s\t%s\t%s\t%s\n" "" $MIME $DESKTOP $FIND $APPICON + + if [[ "$APPICON" ]]; then + convert \ + "default/$FIND.png" \( -density 400 $APPICON -resize 256 \) \ + -gravity north -geometry +0+20 \ + -compose darken -composite $OUT_PATH/$FILE.png + fi + fi + fi + + mogrify "$OUT_PATH/$FILE.png" \ + -gravity northwest -pointsize 60 -rotate 90 \ + -stroke '#444' -strokewidth 2 -annotate 0 "${FILE##*-}" \ + -fill '#ff0' -annotate 0 "${FILE##*-}" \ + -rotate -90 -resize 256 $OUT_PATH/$FILE.png + +done < $INPUT_FILE diff --git a/scalable/mimetypes/templates/test-globs b/scalable/mimetypes/templates/test-globs new file mode 100644 index 0000000..9b062d7 --- /dev/null +++ b/scalable/mimetypes/templates/test-globs @@ -0,0 +1,4 @@ +text/x-csrc:*.c +application/x-blender:*.blend +text/plain:*.txt +application/x-kexiproject-sqlite3:*.kkk -- cgit v1.2.3