wok-next view make-slitaz-icons/stuff/mksit.sh @ rev 18805
vanessa_socket: typo
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jan 13 22:24:07 2016 +0100 (2016-01-13) |
parents | f0efa645bcab |
children | d0119053ba28 |
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="160108"
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 c application-exit dialog-close # gtk_stock 16,24; Transmission (GTK+3) needs it # 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 c document-open # gtk_stock 16,24; Transmission (GTK+3) needs it
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 c edit-copy # gtk_stock 16,24; Transmission (GTK+3) needs it
254 s edit-cut # gtk_stock 16,24
255 c edit-delete # gtk_stock 16,24; Transmission (GTK+3) needs it
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 c edit-select-all # gtk_stock 16,24; Transmission (GTK+3) needs it
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 c help-about # gtk_stock 16,24; Transmission (GTK+3) needs it
286 c help-contents # gtk_stock 16,24; Transmission (GTK+3) needs it
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 c list-add # gtk_stock 16,24; Transmission (GTK+3) needs it
293 c list-remove # gtk_stock 16,24; Transmission (GTK+3) needs it
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 c media-playback-pause # gtk_stock 16,24 but Audacious needs it
307 c media-playback-start # gtk_stock 16,24 but Audacious needs it
308 c media-playback-stop # gtk_stock 16,24 but Audacious needs it
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 c media-skip-backward # gtk_stock 16,24 but Audacious needs it
313 c media-skip-forward # gtk_stock 16,24 but Audacious needs it
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 c system-run # gtk_stock 16,24; Transmission (GTK+3) needs it
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 c window-close # gtk_stock 16,20,24; Transmission (GTK+3) needs it
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
350 c extract-archive # tazpkg-box, xarchiver...
351 c package-install # tazpkg-box
353 SIZES='16 48'
354 c document-new # Yad:tazbox new-file
355 c document-properties # Yad:tazbox locale, tazbox manage-i18n
358 ############################
359 # Standard Animation Icons #
360 ############################
361 CATEGORY='animations'; SIZES='16'; echo_cat
363 c process-working
367 ##############################
368 # Standard Application Icons #
369 ##############################
370 CATEGORY='apps'; SIZES='16 48'; echo_cat
372 c accessories-calculator
373 c accessories-character-map
374 c accessories-dictionary
375 c accessories-text-editor
376 c help-browser
377 c multimedia-volume-control # audio-volume-high
378 c preferences-desktop-accessibility
379 c preferences-desktop-font
380 c preferences-desktop-keyboard # keyboard
381 c preferences-desktop-locale
382 c preferences-desktop-multimedia # applications-multimedia
383 c preferences-desktop-screensaver
384 c preferences-desktop-theme
385 c preferences-desktop-wallpaper
386 c system-file-manager
387 c system-software-install # synaptic
388 c system-software-update # update-notifier
389 c utilities-system-monitor
390 c utilities-terminal
391 #-------------------
392 c gcolor2 # gcolor2.desktop
393 c gnome-glchess # chess.desktop
394 c gpicview # gpicview.desktop
395 c tazcalc gnumeric # tazcalc.desktop
396 c alsaplayer gnome-audio # alsaplayer.desktop
397 c leafpad # leafpad.desktop
398 c midori # midori.desktop
399 c mtpaint # mtpaint.desktop
400 c xterm # xterm.desktop
401 c burn-box brasero # burn-box.desktop
402 c iso-image-burn # burn-iso.desktop
403 c system-log-out # lxde-logout.desktop
404 c sudoku gnome-sudoku # sudoku.desktop
405 c utilities-log-viewer # bootlog.desktop
406 c preferences-desktop-display # lxrandr.desktop
407 c tazbug bug-buddy # tazbug.desktop
408 c applets-screenshooter # mtpaint-grab.desktop
409 c tazwikiss zim # tazwikiss.desktop
410 c system-software-installer # tazpanel-pkgs.desktop
411 c session-properties # lxsession-edit.desktop
412 c terminal # sakura.desktop
413 c user_auth # passwd.desktop
414 c preferences-system-time # tazbox-tz.desktop
415 c text-editor # vi.desktop
416 c drive-harddisk-usb # tazusb-box.desktop
417 c drive-optical # tazlito-wiz.desktop
418 c network-wireless # wifi-box.desktop
419 c gparted # gparted.desktop
420 c epdfview acroread # epdfview.desktop
421 c menu-editor # libfm-pref-apps.desktop
422 c preferences-system-windows # obconf.desktop
423 c twitter # twitter.desktop
424 c network-server # httpd.desktop
425 c pcmanfm system-file-manager # pcmanfm.desktop
426 c preferences-desktop-default-applications # tazbox tazapps
429 ###########################
430 # Standard Category Icons #
431 ###########################
432 CATEGORY='categories'; SIZES='16 48'; echo_cat
434 c applications-accessories
435 c applications-development
436 c applications-engineering gnome-do
437 c applications-games
438 c applications-graphics eog # Matrilineare hack
439 c applications-internet web-browser # Matrilineare hack
440 c applications-multimedia
441 c applications-office
442 c applications-other
443 c applications-science
444 c applications-system
445 c applications-utilities
446 c preferences-desktop
447 c preferences-desktop-peripherals
448 c preferences-desktop-personal
449 c preferences-other
450 c preferences-system
451 c preferences-system-network
452 c system-help help-contents
456 #########################
457 # Standard Device Icons #
458 #########################
459 CATEGORY='devices'; SIZES='16'; echo_cat
461 c audio-card
462 c audio-input-microphone gnome-sound-recorder
463 c battery
464 c camera camera-photo
465 c camera-photo
466 c camera-video
467 c camera-web
468 c computer
469 c drive-harddisk
470 c drive-optical
471 c drive-removable-media drive-harddisk-removable # Matrilineare hack
472 c input-gaming
473 c input-keyboard
474 c input-mouse
475 c input-tablet
476 c media-flash drive-removable-media-usb
477 s media-floppy # gtk_stock 16,24
478 s media-optical drive-optical # gtk_stock 16,24 # Matrilineare hack
479 c media-tape
480 c modem
481 c multimedia-player
482 c network-wired
483 c network-wireless
484 c pda
485 c phone ekiga
486 c printer
487 c scanner
488 c video-display
489 #---------------------------
490 c camera camera-photo # Matrilineare hack
492 # Big drive icons on the PCManFM Desktop
493 SIZES='48'
494 c drive-harddisk
495 c drive-optical
496 c drive-removable-media drive-harddisk-removable # Matrilineare hack
497 c video-display # LXPanel - About
500 #########################
501 # Standard Emblem Icons #
502 #########################
503 CATEGORY='emblems'; SIZES='16'; echo_cat
505 c emblem-default
506 c emblem-documents x-office-document # Matrilineare hack
507 c emblem-downloads
508 c emblem-favorite
509 c emblem-important
510 c emblem-mail
511 c emblem-photos image-jpeg
512 c emblem-readonly
513 c emblem-shared
514 c emblem-symbolic-link
515 c emblem-synchronized emblem-ubuntuone-synchronized
516 c emblem-system
517 c emblem-unreadable
521 ##########################
522 # Standard Emotion Icons #
523 ##########################
524 CATEGORY='emotions'; SIZES='16'; echo_cat
526 c face-angel
527 c face-angry
528 c face-cool
529 c face-crying
530 c face-devilish
531 c face-embarrassed
532 c face-kiss
533 c face-laugh
534 c face-monkey
535 c face-plain
536 c face-raspberry
537 c face-sad
538 c face-sick
539 c face-smile
540 c face-smile-big
541 c face-smirk
542 c face-surprise
543 c face-tired
544 c face-uncertain
545 c face-wink
546 c face-worried
550 ################################
551 # Standard International Icons #
552 ################################
554 #flag-aa
555 #flag-RU
556 #flag-UA
560 ############################
561 # Standard MIME Type Icons #
562 ############################
563 CATEGORY='mimetypes'; SIZES='48 16'; echo_cat
564 A='application'
566 # generic icons described in the /usr/share/mime/packages/freedesktop.org.xml
567 c application-x-executable
568 c audio-x-generic
569 c font-x-generic
570 c image-x-generic
571 c package-x-generic
572 c text-html
573 c text-x-generic # gtk_stock 16,24 but...
574 c text-x-generic-template
575 c text-x-script
576 c video-x-generic
577 c x-office-address-book
578 c x-office-calendar
579 c x-office-document
580 c x-office-presentation
581 c x-office-spreadsheet
582 #--------------------------------------
583 # special types
584 c $A-octet-stream
585 c $A-x-zerosize empty
587 # archives
588 c $A-gzip $A-x-gzip
589 c $A-x-compressed-tar
590 c $A-x-7z-compressed
591 c $A-x-ace
592 c $A-x-arc
593 c $A-x-archive
594 c $A-x-rar
595 c $A-x-tar
596 c $A-zip
597 c $A-vnd.ms-cab-compressed $A-x-archive
598 c $A-x-alz $A-x-archive
599 c $A-x-arj
600 c $A-x-bcpio $A-x-archive
601 c $A-x-bzip
602 c $A-x-bzip-compressed-tar
603 c $A-x-lha
604 c $A-x-lzma $A-x-archive
605 c $A-x-lzma-compressed-tar $A-x-archive
606 c $A-x-lzop $A-x-archive
607 c $A-x-tzo $A-x-archive
608 c $A-x-xar $A-x-archive
609 c $A-x-xz $A-x-archive
610 c $A-x-xz-compressed-tar $A-x-archive
612 # packages
613 c $A-vnd.android.package-archive
614 c $A-x-deb
615 c $A-x-java-archive
616 c $A-x-rpm
617 c $A-x-source-rpm $A-x-rpm
618 c $A-x-tazpkg package-x-generic
620 c $A-illustrator
621 c $A-javascript
622 c $A-mbox
623 c $A-pdf
624 c $A-pgp-signature $A-pgp-keys
625 c $A-rtf
626 c $A-x-apple-diskimage $A-x-cd-image
627 c $A-x-cbr comix
628 c $A-x-cd-image
629 c $A-x-core emblem-danger
630 c $A-x-designer
631 c $A-x-desktop
633 c $A-x-theme
634 c $A-x-emerald-theme $A-x-theme
635 c $A-x-openbox-theme $A-x-theme
637 c $A-x-generic $A-x-executable
638 c $A-x-object $A-octet-stream
639 c $A-x-sharedlib $A-octet-stream
641 c $A-x-gettext-translation preferences-desktop-locale
642 c text-x-gettext-translation preferences-desktop-locale
643 c text-x-gettext-translation-template text-x-generic-template
645 c $A-x-gtk-builder $A-x-glade
646 c $A-x-m4
647 c $A-xml
648 c $A-x-ms-dos-executable
650 c $A-x-perl text-x-script
651 c $A-x-python-bytecode
652 c $A-x-shellscript
653 c $A-x-sqlite3
654 c $A-x-trash
655 c $A-x-x509-ca-cert $A-pgp-keys
657 c audio-mpeg
658 c audio-x-vorbis+ogg
659 c audio-x-wav
660 c image-x-eps
661 c image-x-xcursor ccsm
662 c inode-blockdevice block-device
663 c inode-chardevice chardevice
664 c inode-directory
665 c inode-mount-point drive-removable-media
666 c inode-symlink emblem-symbolic-link
667 c inode-x-generic emblem-generic
668 c text-css
669 c text-plain
670 c text-richtext
671 c text-x-authors
672 c text-x-changelog
673 c text-x-chdr
674 c text-x-copying
675 c text-x-csrc
676 c text-x-install
677 c text-x-log text-x-changelog
678 c text-x-makefile
679 c text-x-markdown text-x-source
680 c text-x-patch
681 c text-x-python
682 c text-x-readme
683 c text-x-tazpkg-receipt text-x-script
685 c application-x-shockwave-flash # Midori
686 c unknown # for unknown mimetypes in PCManFM
689 ########################
690 # Standard Place Icons #
691 ########################
692 CATEGORY='places'; SIZES='16 48'; echo_cat
694 c folder # gtk_stock 16,24
695 c folder-remote # gtk_stock 16,24
696 c network-server
697 c network-workgroup
698 c start-here
699 c user-bookmarks
700 c user-desktop # gtk_stock 16,24
701 c user-home # gtk_stock 16,24
702 c user-trash
703 #------------------
704 # PCManFM XDG home sub-folders
705 c folder-documents
706 c folder-download
707 c folder-music
708 c folder-pictures
709 c folder-publicshare
710 c folder-templates
711 c folder-videos
715 #########################
716 # Standard Status Icons #
717 #########################
718 CATEGORY='status'; SIZES='22'; echo_cat
720 c appointment-missed
721 c appointment-soon
722 c audio-volume-high # gtk_stock 24
723 c audio-volume-low # gtk_stock 24
724 c audio-volume-medium # gtk_stock 24
725 c audio-volume-muted # gtk_stock 24
726 c battery-caution notification-battery-empty
727 c battery-low notification-battery-low
728 c dialog-error # gtk_stock 48
729 c dialog-information # gtk_stock 16,24,48
730 c dialog-password # gtk_stock 48
731 c dialog-question # gtk_stock 48
732 c dialog-warning # gtk_stock 48
733 c folder-drag-accept
734 c folder-open
735 c folder-visiting
736 c image-loading
737 c image-missing # gtk_stock 16,24
738 c mail-attachment
739 c mail-unread
740 c mail-read
741 c mail-replied
742 c mail-signed
743 c mail-signed-verified
744 c media-playlist-repeat
745 c media-playlist-shuffle
746 c network-error
747 c network-idle # gtk_stock 16,24
748 c network-offline
749 c network-receive
750 c network-transmit
751 c network-transmit-receive
752 c printer-error # gtk_stock 16,24
753 c printer-printing
754 c security-high
755 c security-medium
756 c security-low
757 c software-update-available
758 c software-update-urgent
759 c sync-error
760 c sync-synchronizing
761 c task-due
762 c task-past-due
763 c user-available
764 c user-away
765 c user-idle
766 c user-offline
767 #c user-trash-full
768 c weather-clear
769 c weather-clear-night
770 c weather-few-clouds
771 c weather-few-clouds-night
772 c weather-fog
773 c weather-overcast
774 c weather-severe-alert
775 c weather-showers
776 c weather-showers-scattered
777 c weather-snow
778 c weather-storm
779 #------------------
780 c system-shutdown-restart-panel # LXPanel logout icon (slitaz-logout.desktop)
782 SIZES="48 16"
783 c user-trash-full # PCManFM desktop
784 c dialog-password # tazbox su default icon
785 c dialog-error # tazbox su error icon
786 c dialog-information
787 c dialog-password
788 c dialog-question
789 c dialog-warning
790 c appointment-soon # Yad:tazbox manage-i18n
792 # LXPanel status icons
793 SIZES="22"
794 c gnome-netstatus-0-24 nm-signal-25
795 c gnome-netstatus-25-49 nm-signal-50
796 c gnome-netstatus-50-74 nm-signal-75
797 c gnome-netstatus-75-100 nm-signal-100
798 c gnome-netstatus-disconn network-error
799 c gnome-netstatus-error network-error
800 c gnome-netstatus-idle network-idle
801 c gnome-netstatus-rx network-receive
802 c gnome-netstatus-tx network-transmit
803 c gnome-netstatus-txrx network-transmit-receive
805 # c avatar-default # 16x16 with canvas 22x22: for "slitaz-logout.desktop"
809 #####
811 echo -n "Original "; size
813 #####
815 if [ "$IS" == "yes" ]; then
816 echo -n "Inkscape... "
817 # convert svg to png
818 # rarely inkscape may fail, good that we leave original file
819 find $TO -type f -iname '*.svg' \( -exec sh -c "export E={}; inkscape -z -f \$E -e \${E%svg}png" \; -exec rm {} \; \)
820 size
821 fi
823 #####
825 if [ "$OP" == "yes" ]; then
826 echo -n "Optipng... "
827 # re-compress png files
828 find $TO -type f -iname '*.png' -exec optipng -quiet -strip all $PNGOPT {} \;
829 size
830 fi
832 #####
834 if [ "$SL" == "yes" ]; then
835 echo -n "Symlinks... "
836 MD5FILE=$(mktemp); find $TO -type f -exec md5sum {} \; | sort > $MD5FILE
837 # substitute repeated files by symlinks
838 for md in $(uniq -d -w32 $MD5FILE | cut -c1-32); do
839 make_symlinks $(grep $md $MD5FILE | cut -c35-)
840 done
841 rm "$MD5FILE"
842 # make all symlinks relative
843 SL=$(symlinks -crs $TO 2> /dev/null)
844 size
845 fi
847 #####
849 echo -n 'Make index.theme... '
850 {
851 echo "[Icon Theme]"
852 echo "Name=$NAME"
854 echo -n "Directories="
855 cd "$TO"
856 FOLDERS=$(find . -type d -mindepth 2 | sort | sed "s|^\./||g")
857 FOLDERS_COMMA=$(echo "$FOLDERS" | tr '\n' ',')
858 echo ${FOLDERS_COMMA%,}
860 for FOLDER in $FOLDERS; do
861 echo
862 echo "[$FOLDER]"
863 echo -n "Size="; echo "$FOLDER" | sed 's|^\([0-9]*\).*|\1|'
864 echo -n "Context="
865 case ${FOLDER#*/} in
866 actions) echo 'Actions' ;;
867 animations) echo 'Animations' ;;
868 apps) echo 'Applications' ;;
869 categories) echo 'Categories' ;;
870 devices) echo 'Devices' ;;
871 emblems) echo 'Emblems' ;;
872 emotes) echo 'Emotes' ;;
873 filesystems) echo 'FileSystems' ;;
874 intl) echo 'International' ;;
875 mimetypes) echo 'MimeTypes' ;;
876 places) echo 'Places' ;;
877 status) echo 'Status' ;;
878 *) echo 'Other' ;;
879 esac
880 echo "Type=Threshold"
881 done
882 } > $TO/index.theme
883 echo 'Done'