wok view make-slitaz-icons/stuff/mksit.sh @ rev 18561

Add more icons: make-slitaz-icons, slitaz-icons-faenza, slitaz-icons-faenza-dark
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sun Nov 08 21:43:05 2015 +0200 (2015-11-08)
parents 5e26ab6bd360
children 5b6bd102aa87
line source
1 #!/bin/sh
2 # Make SliTaz icon theme
3 # Aleksej Bobylev <al.bobylev@gmail.com>, 2014-2015
4 # (Started in November 2014)
6 VERSION="151108"
8 . /lib/libtaz.sh
11 ### Functions ###
13 # Usage of utility
15 usage() {
16 cat <<EOT
17 $(basename $0), v. $VERSION
18 Make icon theme for SliTaz GNU/Linux
20 Usage:
21 $(basename $0) [OPTIONS ...]
23 Options:
24 -f <path> The path to the original theme from which the icons will be taken
25 Note that this folder contains the file index.theme
26 -t <path> The path where the folder with a new theme will created
27 Note that existing folder will be silently removed
28 -s <path> Path to icon substitution definitions. Where <path> can point to file
29 or to folder containing file <original theme name>.sub
30 -n 'name' The name of the new theme (default will be taken from -t path)
32 +is -is Whether to use Inkscape to convert svg icons to png (default: +is)
33 +op -op Whether to use Optipng to optimize png icons (default: +op)
34 +sl -sl Whether to replace the same icons by symlinks (default: +sl)
36 -opmax Maximal settings for Optipng (slow but save maximum bytes)
38 -nocolor Don't use color in the log
39 EOT
40 }
43 # Color output
44 colored() {
45 if [ "$color" == 'yes' ]; then
46 colorize $@
47 else
48 echo $2
49 fi
50 }
53 # Find icon (use pre-generated list of icon files)
55 findi() {
56 grep -e "/$1.png" -e "/$1.svg" $ICONSLIST
57 }
60 # Copy icon
62 c() {
63 for SIZE in $SIZES; do
64 FOUND=''
65 for ICON in $(echo "$@" | sed 's|\([^ ]*\)|& gnome-mime-& gnome-dev-&|'); do
66 FINDICON=$(findi $ICON | sed "s|$FROM||g" | grep -e "/$SIZE/" -e "/${SIZE}x$SIZE/")
68 if [ -n "$FINDICON" ]; then
69 if [ $(echo "$FINDICON" | wc -l) != "1" ]; then
70 # Multiple choice
71 if [ "$(md5sum $(echo "$FINDICON" | sed 's|^.*$|'$FROM'&|g') | awk '{print $1}' | sort | uniq | wc -l)" != "1" ]; then
72 # note: really different icons with different md5sum
73 colored 33 "? $1($SIZE): Multiple choice:"
74 echo "$FINDICON" | sed 's|^.*$| * &|g'
75 fi
76 FINDICON="$(echo "$FINDICON" | head -n1)"
77 fi
78 mkdir -p $TO/${SIZE}x${SIZE}/$CATEGORY
80 BASE_FINDICON="$(basename $FINDICON .png)"
81 BASE_FINDICON="$(basename $BASE_FINDICON .svg)"
83 if [ "$1" == "$BASE_FINDICON" ]; then
84 colored 32 "+ $1($SIZE)"
85 else
86 colored 34 "+ $1($SIZE) <= $(basename $FINDICON)"
87 fi
89 EXT=${FINDICON##*.}
90 cp -aL $FROM/$FINDICON $TO/${SIZE}x${SIZE}/$CATEGORY/$1.$EXT
92 FOUND='yes'
93 break
94 fi
95 done
96 if [ -z "$FOUND" ]; then
97 colored 31 "- $1($SIZE) NOT FOUND!"
98 fi
99 done
100 }
103 # Maybe copy stock icon
105 s() {
106 if [ "${BASED_ON%%-*}" != "Faenza" ]; then
107 c $@
108 else
109 echo ". $1"
110 fi
111 }
114 # Return shortest line
116 shortest_line() {
117 S=$1; shift
118 for L in $@; do
119 [ "${#L}" -lt "${#S}" ] && S="$L"
120 done
121 echo "$S"
122 }
125 # Replace the same files by symlinks, $@ - list of identical files
127 make_symlinks() {
128 S=$(shortest_line $@)
129 for file in $@; do
130 [ "$S" != "$file" ] && ln -sf $S $file
131 done
132 }
135 # Calculate size in bytes
137 size() {
138 echo -n "size: "
139 find "$TO" -type f -exec stat -c %s {} \; | awk 'BEGIN{SUM=0}{SUM+=$1}END{print SUM}'
140 }
143 # Print out category
145 echo_cat() {
146 echo
147 colored 35 $CATEGORY
148 colored 35 $(echo -n $CATEGORY | tr -c '' '-')
149 }
155 case "$1" in
156 -h|--help) usage; exit 0 ;;
157 -V|--version) echo "$(basename $0) v. $VERSION"; exit 0 ;;
158 esac
161 # Default parameters:
163 IS='yes'; OP='yes'; SL='yes'; PNGOPT=''; SUBS=''; color='yes'
165 while [ "x$1" != "x" ]; do
166 case "$1" in
167 -f) FROM="$2"; shift; BASED_ON="$(basename ${FROM%/})" ;;
168 -t) TO="$2"; shift; NAME="$(basename ${TO%/})" ;;
169 -s) SUBS="$2"; shift; if [ -d "$SUBS" ]; then SUBS="${SUBS%/}/$BASED_ON.sub"; fi ;;
170 -n) NAME="$2"; shift ;;
171 -is) IS='no' ;;
172 +is) IS='yes' ;;
173 -op) OP='no' ;;
174 +op) OP='yes' ;;
175 -sl) SL='no' ;;
176 +sl) SL='yes' ;;
177 -opmax) PNGOPT="-o7 -zm1-9" ;;
178 -nocolor) color='no' ;;
179 esac
180 shift
181 done
183 if [ "x$FROM" == "x" -o "x$TO" == "x" ]; then
184 echo "There are no required parameters (-f or -t)!"; exit 1
185 fi
187 echo "Check components..."
188 if [ $IS == 'yes' ]; then
189 echo -n "Inkscape: "
190 if [ -x "$(which inkscape)" ]; then
191 echo "$(which inkscape)"
192 else
193 colored 31 "not found! Force '-is'"; IS='no'
194 fi
195 fi
196 if [ $OP == 'yes' ]; then
197 echo -n "Optipng: "
198 if [ -x "$(which optipng)" ]; then
199 echo "$(which optipng)"
200 else
201 colored 31 "not found! Force '-op'"; OP='no'
202 fi
203 fi
204 echo -n "Symlinks: "
205 if [ -x "$(which symlinks)" ]; then
206 echo "$(which symlinks)"
207 else
208 colored 31 "not found! Abort."; exit 1
209 fi
210 echo
212 echo "Options: Inkscape=\"$IS\" Optipng=\"$OP\" Symlinks=\"$SL\""
213 echo "From: \"$FROM\""
214 echo "To: \"$TO\""
215 echo "Subs: \"$SUBS\""
216 echo "Name: \"$NAME\""
217 echo
220 rm -rf $TO
222 # make files list
223 ICONSLIST=$(mktemp)
224 find $FROM -type f -o -type l > $ICONSLIST
230 #########################
231 # Standard Action Icons #
232 #########################
233 CATEGORY='actions'; SIZES='16'; echo_cat
235 c address-book-new
236 s application-exit dialog-close # gtk_stock 16,24 # elementary hack
237 c appointment-new
238 c call-start
239 c call-stop process-stop # elementary hack
240 c contact-new
241 s document-new # gtk_stock 16,24
242 s document-open # gtk_stock 16,24
243 s document-open-recent # gtk_stock 16,24
244 c document-page-setup
245 s document-print # gtk_stock 16,24
246 s document-print-preview # gtk_stock 16,24
247 s document-properties # gtk_stock 16,24
248 s document-revert # gtk_stock 16,24
249 s document-save # gtk_stock 16,24
250 s document-save-as document-save # gtk_stock 16,24 # elementary hack
251 c document-send document-export # elementary hack
252 c edit-clear remove # gtk_stock 16,24; Yad:tazbox new-file needs it # elementary hack
253 s edit-copy # gtk_stock 16,24
254 s edit-cut # gtk_stock 16,24
255 s edit-delete # gtk_stock 16,24
256 s edit-find # gtk_stock 16,24
257 s edit-find-replace edit-find # gtk_stock 16,24 # elementary hack
258 s edit-paste # gtk_stock 16,24
259 s edit-redo # gtk_stock 16,24
260 s edit-select-all # gtk_stock 16,24
261 s edit-undo # gtk_stock 16,24
262 c folder-new
263 s format-indent-less # gtk_stock 16,24
264 s format-indent-more # gtk_stock 16,24
265 s format-justify-center # gtk_stock 16,24
266 s format-justify-fill # gtk_stock 16,24
267 s format-justify-left # gtk_stock 16,24
268 s format-justify-right # gtk_stock 16,24
269 c format-text-direction-ltr
270 c format-text-direction-rtl
271 s format-text-bold # gtk_stock 16,24
272 s format-text-italic # gtk_stock 16,24
273 s format-text-underline # gtk_stock 16,24
274 s format-text-strikethrough # gtk_stock 16,24
275 s go-bottom # gtk_stock 16,24
276 c go-down # gtk_stock 16,24 but Yad:scp-box needs it
277 s go-first # gtk_stock 16,24
278 s go-home # gtk_stock 16,24
279 s go-jump # gtk_stock 16,24
280 s go-last # gtk_stock 16,24
281 s go-next # gtk_stock 16,24
282 s go-previous # gtk_stock 16,24
283 s go-top # gtk_stock 16,24
284 c go-up # gtk_stock 16,24 but Yad:scp-box needs it
285 s help-about # gtk_stock 16,24
286 s help-contents # gtk_stock 16,24
287 c help-faq help-hint # elementary hack
288 c insert-image
289 c insert-link
290 c insert-object
291 c insert-text
292 s list-add # gtk_stock 16,24
293 s list-remove # gtk_stock 16,24
294 c mail-forward
295 c mail-mark-important
296 c mail-mark-junk
297 c mail-mark-notjunk
298 c mail-mark-read
299 c mail-mark-unread
300 c mail-message-new
301 c mail-reply-all
302 c mail-reply-sender
303 c mail-send
304 c mail-send-receive
305 c media-eject list-remove # Matrilineare hack
306 s media-playback-pause # gtk_stock 16,24
307 s media-playback-start # gtk_stock 16,24
308 s media-playback-stop # gtk_stock 16,24
309 s media-record # gtk_stock 16,24
310 s media-seek-backward go-previous # gtk_stock 16,24 # Matrilineare hack
311 s media-seek-forward go-next # gtk_stock 16,24 # Matrilineare hack
312 s media-skip-backward # gtk_stock 16,24
313 s media-skip-forward # gtk_stock 16,24
314 c object-flip-horizontal
315 c object-flip-vertical
316 c object-rotate-left
317 c object-rotate-right
318 s process-stop # gtk_stock 16,24
319 c system-lock-screen lock # Matrilineare hack
320 c system-log-out contact-new # Matrilineare hack
321 s system-run # gtk_stock 16,24
322 c system-search find # Matrilineare hack
323 c system-reboot system-run # Matrilineare hack
324 c system-shutdown system-shutdown-panel # Matrilineare hack
325 s tools-check-spelling # gtk_stock 16,24
326 s view-fullscreen # gtk_stock 16,24
327 c view-refresh # gtk_stock 16,24 but Yad:tazbox manage-i18n needs it
328 s view-restore # gtk_stock 16,24
329 s view-sort-ascending # gtk_stock 16,24
330 s view-sort-descending # gtk_stock 16,24
331 s window-close # gtk_stock 16,20,24
332 c window-new
333 s zoom-fit-best # gtk_stock 16,24
334 s zoom-in # gtk_stock 16,24
335 s zoom-original # gtk_stock 16,24
336 s zoom-out # gtk_stock 16,24
337 #---------------------------
338 # PCManFM panel and menu
339 c tab-new
340 c view-choose preferences-desktop
341 c view-filter
342 c view-sidetree
344 c gtk-execute # LXPanel menu: run
345 c system-shutdown-panel-restart # LXPanel menu: logout
346 c gtk-close # Yad close button
347 c gtk-go-forward gtk-go-forward-ltr # tazbox tz Yad dialog
348 c bookmark-new # Midori
349 c empty # Yad:tazbox new-file
351 SIZES='16 48'
352 c document-new # Yad:tazbox new-file
353 c stock_bookmark # Yad:tazbox all-apps
354 c document-properties # Yad:tazbox locale, tazbox manage-i18n
357 ############################
358 # Standard Animation Icons #
359 ############################
360 CATEGORY='animations'; SIZES='16'; echo_cat
362 c process-working
366 ##############################
367 # Standard Application Icons #
368 ##############################
369 CATEGORY='apps'; SIZES='16 48'; echo_cat
371 c accessories-calculator
372 c accessories-character-map
373 c accessories-dictionary
374 c accessories-text-editor
375 c help-browser
376 c multimedia-volume-control # audio-volume-high
377 c preferences-desktop-accessibility
378 c preferences-desktop-font
379 c preferences-desktop-keyboard # keyboard
380 c preferences-desktop-locale
381 c preferences-desktop-multimedia # applications-multimedia
382 c preferences-desktop-screensaver
383 c preferences-desktop-theme
384 c preferences-desktop-wallpaper
385 c system-file-manager
386 c system-software-install # synaptic
387 c system-software-update # update-notifier
388 c utilities-system-monitor
389 c utilities-terminal
390 #-------------------
391 c gcolor2 # gcolor2.desktop
392 c gnome-glchess # chess.desktop
393 c gpicview # gpicview.desktop
394 c tazcalc gnumeric # tazcalc.desktop
395 c alsaplayer gnome-audio # alsaplayer.desktop
396 c leafpad # leafpad.desktop
397 c midori # midori.desktop
398 c mtpaint # mtpaint.desktop
399 c xterm # xterm.desktop
400 c burn-box brasero # burn-box.desktop
401 c iso-image-burn # burn-iso.desktop
402 c system-log-out # lxde-logout.desktop
403 c sudoku gnome-sudoku # sudoku.desktop
404 c utilities-log-viewer # bootlog.desktop
405 c preferences-desktop-display # lxrandr.desktop
406 c tazbug bug-buddy # tazbug.desktop
407 c applets-screenshooter # mtpaint-grab.desktop
408 c tazwikiss zim # tazwikiss.desktop
409 c system-software-installer # tazpanel-pkgs.desktop
410 c session-properties # lxsession-edit.desktop
411 c terminal # sakura.desktop
412 c user_auth # passwd.desktop
413 c preferences-system-time # tazbox-tz.desktop
414 c text-editor # vi.desktop
415 c drive-harddisk-usb # tazusb-box.desktop
416 c drive-optical # tazlito-wiz.desktop
417 c network-wireless # wifi-box.desktop
418 c gparted # gparted.desktop
419 c epdfview acroread # epdfview.desktop
420 c menu-editor # libfm-pref-apps.desktop
421 c preferences-system-windows # obconf.desktop
422 c twitter # twitter.desktop
423 c network-server # httpd.desktop
424 c pcmanfm system-file-manager # pcmanfm.desktop
425 c preferences-desktop-default-applications # tazbox tazapps
428 ###########################
429 # Standard Category Icons #
430 ###########################
431 CATEGORY='categories'; SIZES='16 48'; echo_cat
433 c applications-accessories
434 c applications-development
435 c applications-engineering
436 c applications-games
437 c applications-graphics eog # Matrilineare hack
438 c applications-internet web-browser # Matrilineare hack
439 c applications-multimedia
440 c applications-office
441 c applications-other
442 c applications-science
443 c applications-system
444 c applications-utilities
445 c preferences-desktop
446 c preferences-desktop-peripherals
447 c preferences-desktop-personal
448 c preferences-other
449 c preferences-system
450 c preferences-system-network
451 c system-help
455 #########################
456 # Standard Device Icons #
457 #########################
458 CATEGORY='devices'; SIZES='16'; echo_cat
460 c audio-card
461 c audio-input-microphone
462 c battery
463 c camera-photo
464 c camera-video
465 c camera-web
466 c computer
467 c drive-harddisk
468 c drive-optical
469 c drive-removable-media drive-harddisk-removable # Matrilineare hack
470 c input-gaming
471 c input-keyboard
472 c input-mouse
473 c input-tablet
474 c media-flash
475 s media-floppy # gtk_stock 16,24
476 s media-optical drive-optical # gtk_stock 16,24 # Matrilineare hack
477 c media-tape
478 c modem
479 c multimedia-player
480 c network-wired
481 c network-wireless
482 c pda
483 c phone
484 c printer
485 c scanner
486 c video-display
487 #---------------------------
488 c camera camera-photo # Matrilineare hack
490 # Big drive icons on the PCManFM Desktop
491 SIZES='48'
492 c drive-harddisk
493 c drive-optical
494 c drive-removable-media drive-harddisk-removable # Matrilineare hack
495 c video-display # LXPanel - About
498 #########################
499 # Standard Emblem Icons #
500 #########################
501 CATEGORY='emblems'; SIZES='16'; echo_cat
503 c emblem-default
504 c emblem-documents x-office-document # Matrilineare hack
505 c emblem-downloads
506 c emblem-favorite
507 c emblem-important
508 c emblem-mail
509 c emblem-photos
510 c emblem-readonly
511 c emblem-shared
512 c emblem-symbolic-link
513 c emblem-synchronized
514 c emblem-system
515 c emblem-unreadable
519 ##########################
520 # Standard Emotion Icons #
521 ##########################
522 CATEGORY='emotions'; SIZES='16'; echo_cat
524 c face-angel
525 c face-angry
526 c face-cool
527 c face-crying
528 c face-devilish
529 c face-embarrassed
530 c face-kiss
531 c face-laugh
532 c face-monkey
533 c face-plain
534 c face-raspberry
535 c face-sad
536 c face-sick
537 c face-smile
538 c face-smile-big
539 c face-smirk
540 c face-surprise
541 c face-tired
542 c face-uncertain
543 c face-wink
544 c face-worried
548 ################################
549 # Standard International Icons #
550 ################################
552 #flag-aa
553 #flag-RU
554 #flag-UA
558 ############################
559 # Standard MIME Type Icons #
560 ############################
561 CATEGORY='mimetypes'; SIZES='48 16'; echo_cat
562 A='application'
564 # generic icons described in the /usr/share/mime/packages/freedesktop.org.xml
565 c application-x-executable
566 c audio-x-generic
567 c font-x-generic
568 c image-x-generic
569 c package-x-generic
570 c text-html
571 c text-x-generic # gtk_stock 16,24 but...
572 c text-x-generic-template
573 c text-x-script
574 c video-x-generic
575 c x-office-address-book
576 c x-office-calendar
577 c x-office-document
578 c x-office-presentation
579 c x-office-spreadsheet
580 #--------------------------------------
581 # special types
582 c $A-octet-stream
583 c $A-x-zerosize
585 # archives
586 c $A-gzip
587 c $A-x-compressed-tar
588 c $A-x-7z-compressed
589 c $A-x-ace
590 c $A-x-arc
591 c $A-x-archive
592 c $A-x-rar
593 c $A-x-tar
594 c $A-zip
595 c $A-vnd.ms-cab-compressed
596 c $A-x-alz
597 c $A-x-arj
598 c $A-x-bcpio
599 c $A-x-bzip
600 c $A-x-bzip-compressed-tar
601 c $A-x-lha
602 c $A-x-lzma
603 c $A-x-lzma-compressed-tar
604 c $A-x-lzop
605 c $A-x-tzo
606 c $A-x-xar
607 c $A-x-xz
608 c $A-x-xz-compressed-tar
610 # packages
611 c $A-vnd.android.package-archive
612 c $A-x-deb
613 c $A-x-java-archive
614 c $A-x-rpm
615 c $A-x-source-rpm $A-x-rpm
616 c $A-x-tazpkg
618 c $A-illustrator
619 c $A-javascript
620 c $A-mbox
621 c $A-pdf
622 c $A-pgp-signature
623 c $A-rtf
624 c $A-x-apple-diskimage $A-x-cd-image
625 c $A-x-cbr
626 c $A-x-cd-image
627 c $A-x-core
628 c $A-x-designer
629 c $A-x-desktop
631 c $A-x-theme
632 c $A-x-emerald-theme $A-x-theme
633 c $A-x-openbox-theme $A-x-theme
635 c $A-x-generic
636 c $A-x-object
637 c $A-x-sharedlib
639 c $A-x-gettext-translation
640 c text-x-gettext-translation
641 c text-x-gettext-translation-template
643 c $A-x-gtk-builder
644 c $A-x-m4
645 c $A-xml
646 c $A-x-ms-dos-executable
648 c $A-x-perl
649 c $A-x-python-bytecode
650 c $A-x-shellscript
651 c $A-x-sqlite3
652 c $A-x-trash
653 c $A-x-x509-ca-cert
655 c audio-mpeg
656 c audio-x-vorbis+ogg
657 c audio-x-wav
658 c image-x-eps
659 c image-x-xcursor
660 c inode-blockdevice block-device
661 c inode-chardevice chardevice
662 c inode-directory
663 c inode-mount-point
664 c inode-symlink
665 c inode-x-generic
666 c text-css
667 c text-plain
668 c text-richtext
669 c text-x-authors
670 c text-x-changelog
671 c text-x-chdr
672 c text-x-copying
673 c text-x-csrc
674 c text-x-install
675 c text-x-log
676 c text-x-makefile
677 c text-x-markdown
678 c text-x-patch
679 c text-x-python
680 c text-x-readme
681 c text-x-tazpkg-receipt text-x-script
683 c application-x-shockwave-flash # Midori
686 ########################
687 # Standard Place Icons #
688 ########################
689 CATEGORY='places'; SIZES='16 48'; echo_cat
691 c folder # gtk_stock 16,24
692 c folder-remote # gtk_stock 16,24
693 c network-server
694 c network-workgroup
695 c start-here
696 c user-bookmarks
697 c user-desktop # gtk_stock 16,24
698 c user-home # gtk_stock 16,24
699 c user-trash
700 #------------------
701 # PCManFM XDG home sub-folders
702 c folder-documents
703 c folder-download
704 c folder-music
705 c folder-pictures
706 c folder-publicshare
707 c folder-templates
708 c folder-videos
712 #########################
713 # Standard Status Icons #
714 #########################
715 CATEGORY='status'; SIZES='22'; echo_cat
717 c appointment-missed
718 c appointment-soon
719 c audio-volume-high # gtk_stock 24
720 c audio-volume-low # gtk_stock 24
721 c audio-volume-medium # gtk_stock 24
722 c audio-volume-muted # gtk_stock 24
723 c battery-caution
724 c battery-low
725 c dialog-error # gtk_stock 48
726 c dialog-information # gtk_stock 16,24,48
727 c dialog-password # gtk_stock 48
728 c dialog-question # gtk_stock 48
729 c dialog-warning # gtk_stock 48
730 c folder-drag-accept
731 c folder-open
732 c folder-visiting
733 c image-loading
734 c image-missing # gtk_stock 16,24
735 c mail-attachment
736 c mail-unread
737 c mail-read
738 c mail-replied
739 c mail-signed
740 c mail-signed-verified
741 c media-playlist-repeat
742 c media-playlist-shuffle
743 c network-error
744 c network-idle # gtk_stock 16,24
745 c network-offline
746 c network-receive
747 c network-transmit
748 c network-transmit-receive
749 c printer-error # gtk_stock 16,24
750 c printer-printing
751 c security-high
752 c security-medium
753 c security-low
754 c software-update-available
755 c software-update-urgent
756 c sync-error
757 c sync-synchronizing
758 c task-due
759 c task-past-due
760 c user-available
761 c user-away
762 c user-idle
763 c user-offline
764 #c user-trash-full
765 c weather-clear
766 c weather-clear-night
767 c weather-few-clouds
768 c weather-few-clouds-night
769 c weather-fog
770 c weather-overcast
771 c weather-severe-alert
772 c weather-showers
773 c weather-showers-scattered
774 c weather-snow
775 c weather-storm
776 #------------------
777 c system-shutdown-restart-panel # LXPanel logout icon (slitaz-logout.desktop)
779 SIZES="48 16"
780 c user-trash-full # PCManFM desktop
781 c dialog-password # tazbox su default icon
782 c dialog-error # tazbox su error icon
783 c dialog-information
784 c dialog-password
785 c dialog-question
786 c dialog-warning
787 c appointment-soon # Yad:tazbox manage-i18n
789 # LXPanel status icons
790 SIZES="22"
791 c gnome-netstatus-0-24 nm-signal-25
792 c gnome-netstatus-25-49 nm-signal-50
793 c gnome-netstatus-50-74 nm-signal-75
794 c gnome-netstatus-75-100 nm-signal-100
795 c gnome-netstatus-disconn network-error
796 c gnome-netstatus-error network-error
797 c gnome-netstatus-idle network-idle
798 c gnome-netstatus-rx network-receive
799 c gnome-netstatus-tx network-transmit
800 c gnome-netstatus-txrx network-transmit-receive
802 # c avatar-default # 16x16 with canvas 22x22: for "slitaz-logout.desktop"
806 #####
808 echo -n "Original "; size
810 #####
812 if [ "$IS" == "yes" ]; then
813 echo -n "Inkscape... "
814 # convert svg to png
815 # rarely inkscape may fail, good that we leave original file
816 find $TO -type f -iname '*.svg' \( -exec sh -c "export E={}; inkscape -z -f \$E -e \${E%svg}png" \; -exec rm {} \; \)
817 size
818 fi
820 #####
822 if [ "$OP" == "yes" ]; then
823 echo -n "Optipng... "
824 # re-compress png files
825 find $TO -type f -iname '*.png' -exec optipng -quiet -strip all $PNGOPT {} \;
826 size
827 fi
829 #####
831 if [ "$SL" == "yes" ]; then
832 echo -n "Symlinks... "
833 MD5FILE=$(mktemp); find $TO -type f -exec md5sum {} \; | sort > $MD5FILE
834 # substitute repeated files by symlinks
835 for md in $(uniq -d -w32 $MD5FILE | cut -c1-32); do
836 make_symlinks $(grep $md $MD5FILE | cut -c35-)
837 done
838 rm "$MD5FILE"
839 # make all symlinks relative
840 SL=$(symlinks -crs $TO 2> /dev/null)
841 size
842 fi
844 #####
846 echo -n 'Make index.theme... '
847 {
848 echo "[Icon Theme]"
849 echo "Name=$NAME"
851 echo -n "Directories="
852 cd "$TO"
853 FOLDERS=$(find . -type d -mindepth 2 | sort | sed "s|^\./||g")
854 FOLDERS_COMMA=$(echo "$FOLDERS" | tr '\n' ',')
855 echo ${FOLDERS_COMMA%,}
857 for FOLDER in $FOLDERS; do
858 echo
859 echo "[$FOLDER]"
860 echo -n "Size="; echo "$FOLDER" | sed 's|^\([0-9]*\).*|\1|'
861 echo -n "Context="
862 case ${FOLDER#*/} in
863 actions) echo 'Actions' ;;
864 animations) echo 'Animations' ;;
865 apps) echo 'Applications' ;;
866 categories) echo 'Categories' ;;
867 devices) echo 'Devices' ;;
868 emblems) echo 'Emblems' ;;
869 emotes) echo 'Emotes' ;;
870 filesystems) echo 'FileSystems' ;;
871 intl) echo 'International' ;;
872 mimetypes) echo 'MimeTypes' ;;
873 places) echo 'Places' ;;
874 status) echo 'Status' ;;
875 *) echo 'Other' ;;
876 esac
877 echo "Type=Threshold"
878 done
879 } > $TO/index.theme
880 echo 'Done'