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

Update some wget_url
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 15 20:25:22 2022 +0000 (2022-05-15)
parents 02c70d036ea0
children
line source
1 #!/bin/sh
2 # Make SliTaz icon theme
3 # Aleksej Bobylev <al.bobylev@gmail.com>, 2014-2016
4 # (Started in November 2014)
6 VERSION="161031"
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 [ -z "$FROM" -o -z "$TO" ]; 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 c go-first # gtk_stock 16,24
278 s go-home # gtk_stock 16,24
279 s go-jump # gtk_stock 16,24
280 c go-last # gtk_stock 16,24
281 c go-next # gtk_stock 16,24
282 c 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
427 c multimedia-video-player mplayer # tazbox-video.desktop tazbox-video-fullscreen.desktop
430 ###########################
431 # Standard Category Icons #
432 ###########################
433 CATEGORY='categories'; SIZES='16 48'; echo_cat
435 c applications-accessories
436 c applications-development
437 c applications-engineering gnome-do
438 c applications-games
439 c applications-graphics eog # Matrilineare hack
440 c applications-internet web-browser # Matrilineare hack
441 c applications-multimedia
442 c applications-office
443 c applications-other
444 c applications-science
445 c applications-system
446 c applications-utilities
447 c preferences-desktop
448 c preferences-desktop-peripherals
449 c preferences-desktop-personal
450 c preferences-other
451 c preferences-system
452 c preferences-system-network
453 c system-help help-contents
457 #########################
458 # Standard Device Icons #
459 #########################
460 CATEGORY='devices'; SIZES='16'; echo_cat
462 c audio-card
463 c audio-input-microphone gnome-sound-recorder
464 c battery
465 c camera camera-photo
466 c camera-photo
467 c camera-video
468 c camera-web
469 c computer
470 c drive-harddisk
471 c drive-optical
472 c drive-removable-media drive-harddisk-removable # Matrilineare hack
473 c input-gaming
474 c input-keyboard
475 c input-mouse
476 c input-tablet
477 c media-flash drive-removable-media-usb
478 s media-floppy # gtk_stock 16,24
479 s media-optical drive-optical # gtk_stock 16,24 # Matrilineare hack
480 c media-tape
481 c modem
482 c multimedia-player
483 c network-wired
484 c network-wireless
485 c pda
486 c phone ekiga
487 c printer
488 c scanner
489 c video-display
490 #---------------------------
491 c camera camera-photo # Matrilineare hack
493 # Big drive icons on the PCManFM Desktop
494 SIZES='48'
495 c drive-harddisk
496 c drive-optical
497 c drive-removable-media drive-harddisk-removable # Matrilineare hack
498 c video-display # LXPanel - About
501 #########################
502 # Standard Emblem Icons #
503 #########################
504 CATEGORY='emblems'; SIZES='16'; echo_cat
506 c emblem-default
507 c emblem-documents x-office-document # Matrilineare hack
508 c emblem-downloads
509 c emblem-favorite
510 c emblem-important
511 c emblem-mail
512 c emblem-photos image-jpeg
513 c emblem-readonly
514 c emblem-shared
515 c emblem-symbolic-link
516 c emblem-synchronized emblem-ubuntuone-synchronized
517 c emblem-system
518 c emblem-unreadable
522 ##########################
523 # Standard Emotion Icons #
524 ##########################
525 CATEGORY='emotions'; SIZES='16'; echo_cat
527 c face-angel
528 c face-angry
529 c face-cool
530 c face-crying
531 c face-devilish
532 c face-embarrassed
533 c face-kiss
534 c face-laugh
535 c face-monkey
536 c face-plain
537 c face-raspberry
538 c face-sad
539 c face-sick
540 c face-smile
541 c face-smile-big
542 c face-smirk
543 c face-surprise
544 c face-tired
545 c face-uncertain
546 c face-wink
547 c face-worried
551 ################################
552 # Standard International Icons #
553 ################################
555 #flag-aa
556 #flag-RU
557 #flag-UA
561 ############################
562 # Standard MIME Type Icons #
563 ############################
564 CATEGORY='mimetypes'; SIZES='48 16'; echo_cat
565 A='application'
567 # generic icons described in the /usr/share/mime/packages/freedesktop.org.xml
568 c application-x-executable
569 c audio-x-generic
570 c font-x-generic
571 c image-x-generic
572 c package-x-generic
573 c text-html
574 c text-x-generic # gtk_stock 16,24 but...
575 c text-x-generic-template
576 c text-x-script
577 c video-x-generic
578 c x-office-address-book
579 c x-office-calendar
580 c x-office-document
581 c x-office-presentation
582 c x-office-spreadsheet
583 #--------------------------------------
584 # special types
585 c $A-octet-stream
586 c $A-x-zerosize empty
588 # archives
589 c $A-gzip $A-x-gzip
590 c $A-x-compressed-tar
591 c $A-x-7z-compressed
592 c $A-x-ace
593 c $A-x-arc
594 c $A-x-archive
595 c $A-x-rar
596 c $A-x-tar
597 c $A-zip
598 c $A-vnd.ms-cab-compressed $A-x-archive
599 c $A-x-alz $A-x-archive
600 c $A-x-arj
601 c $A-x-bcpio $A-x-archive
602 c $A-x-bzip
603 c $A-x-bzip-compressed-tar
604 c $A-x-lha
605 c $A-x-lzma $A-x-archive
606 c $A-x-lzma-compressed-tar $A-x-archive
607 c $A-x-lzop $A-x-archive
608 c $A-x-tzo $A-x-archive
609 c $A-x-xar $A-x-archive
610 c $A-x-xz $A-x-archive
611 c $A-x-xz-compressed-tar $A-x-archive
613 # packages
614 c $A-vnd.android.package-archive
615 c $A-x-deb
616 c $A-x-java-archive
617 c $A-x-rpm
618 c $A-x-source-rpm $A-x-rpm
619 c $A-x-tazpkg package-x-generic
621 c $A-illustrator
622 c $A-javascript
623 c $A-mbox
624 c $A-pdf
625 c $A-pgp-signature $A-pgp-keys
626 c $A-rtf
627 c $A-x-apple-diskimage $A-x-cd-image
628 c $A-x-cbr comix
629 c $A-x-cd-image
630 c $A-x-core emblem-danger
631 c $A-x-designer
632 c $A-x-desktop
634 c $A-x-theme
635 c $A-x-emerald-theme $A-x-theme
636 c $A-x-openbox-theme $A-x-theme
638 c $A-x-generic $A-x-executable
639 c $A-x-object $A-octet-stream
640 c $A-x-sharedlib $A-octet-stream
642 c $A-x-gettext-translation preferences-desktop-locale
643 c text-x-gettext-translation preferences-desktop-locale
644 c text-x-gettext-translation-template text-x-generic-template
646 c $A-x-gtk-builder $A-x-glade
647 c $A-x-m4
648 c $A-xml
649 c $A-x-ms-dos-executable
651 c $A-x-perl text-x-script
652 c $A-x-python-bytecode
653 c $A-x-shellscript
654 c $A-x-sqlite3
655 c $A-x-trash
656 c $A-x-x509-ca-cert $A-pgp-keys
658 c audio-mpeg
659 c audio-x-vorbis+ogg
660 c audio-x-wav
661 c image-x-eps
662 c image-x-xcursor ccsm
663 c inode-blockdevice block-device
664 c inode-chardevice chardevice
665 c inode-directory
666 c inode-mount-point drive-removable-media
667 c inode-symlink emblem-symbolic-link
668 c inode-x-generic emblem-generic
669 c text-css
670 c text-plain
671 c text-richtext
672 c text-x-authors
673 c text-x-changelog
674 c text-x-chdr
675 c text-x-copying
676 c text-x-csrc
677 c text-x-install
678 c text-x-log text-x-changelog
679 c text-x-makefile
680 c text-x-markdown text-x-source
681 c text-x-patch
682 c text-x-python
683 c text-x-readme
684 c text-x-tazpkg-receipt text-x-script
686 c application-x-shockwave-flash # Midori
687 c unknown # for unknown mimetypes in PCManFM
689 SIZES='16'
690 c package package-x-generic # for Midori: Sidepanel
693 ########################
694 # Standard Place Icons #
695 ########################
696 CATEGORY='places'; SIZES='16 48'; echo_cat
698 c folder # gtk_stock 16,24
699 c folder-remote # gtk_stock 16,24
700 c network-server
701 c network-workgroup
702 c start-here
703 c user-bookmarks
704 c user-desktop # gtk_stock 16,24
705 c user-home # gtk_stock 16,24
706 c user-trash
707 #------------------
708 # PCManFM XDG home sub-folders
709 c folder-documents
710 c folder-download
711 c folder-music
712 c folder-pictures
713 c folder-publicshare
714 c folder-templates
715 c folder-videos
719 #########################
720 # Standard Status Icons #
721 #########################
722 CATEGORY='status'; SIZES='22'; echo_cat
724 c appointment-missed
725 c appointment-soon
726 c audio-volume-high # gtk_stock 24
727 c audio-volume-low # gtk_stock 24
728 c audio-volume-medium # gtk_stock 24
729 c audio-volume-muted # gtk_stock 24
730 c battery-caution notification-battery-empty
731 c battery-low notification-battery-low
732 c dialog-error # gtk_stock 48
733 c dialog-information # gtk_stock 16,24,48
734 c dialog-password # gtk_stock 48
735 c dialog-question # gtk_stock 48
736 c dialog-warning # gtk_stock 48
737 c folder-drag-accept
738 c folder-open
739 c folder-visiting
740 c image-loading
741 c image-missing # gtk_stock 16,24
742 c mail-attachment
743 c mail-unread
744 c mail-read
745 c mail-replied
746 c mail-signed
747 c mail-signed-verified
748 c media-playlist-repeat
749 c media-playlist-shuffle
750 c network-error
751 c network-idle # gtk_stock 16,24
752 c network-offline
753 c network-receive
754 c network-transmit
755 c network-transmit-receive
756 c printer-error # gtk_stock 16,24
757 c printer-printing
758 c security-high
759 c security-medium
760 c security-low
761 c software-update-available
762 c software-update-urgent
763 c sync-error
764 c sync-synchronizing
765 c task-due
766 c task-past-due
767 c user-available
768 c user-away
769 c user-idle
770 c user-offline
771 #c user-trash-full
772 c weather-clear
773 c weather-clear-night
774 c weather-few-clouds
775 c weather-few-clouds-night
776 c weather-fog
777 c weather-overcast
778 c weather-severe-alert
779 c weather-showers
780 c weather-showers-scattered
781 c weather-snow
782 c weather-storm
783 #------------------
784 c system-shutdown-restart-panel # LXPanel logout icon (slitaz-logout.desktop)
786 SIZES="48 16"
787 c user-trash-full # PCManFM desktop
788 c dialog-password # tazbox su default icon
789 c dialog-error # tazbox su error icon
790 c dialog-information
791 c dialog-password
792 c dialog-question
793 c dialog-warning
794 c appointment-soon # Yad:tazbox manage-i18n
796 # LXPanel status icons
797 SIZES="22"
798 c gnome-netstatus-0-24 nm-signal-25
799 c gnome-netstatus-25-49 nm-signal-50
800 c gnome-netstatus-50-74 nm-signal-75
801 c gnome-netstatus-75-100 nm-signal-100
802 c gnome-netstatus-disconn network-error
803 c gnome-netstatus-error network-error
804 c gnome-netstatus-idle network-idle
805 c gnome-netstatus-rx network-receive
806 c gnome-netstatus-tx network-transmit
807 c gnome-netstatus-txrx network-transmit-receive
809 # c avatar-default # 16x16 with canvas 22x22: for "slitaz-logout.desktop"
813 #####
815 echo -n "Original "; size
817 #####
819 if [ "$IS" = "yes" ]; then
820 echo -n "Inkscape... "
821 # convert svg to png
822 # rarely inkscape may fail, good that we leave original file
823 find $TO -type f -iname '*.svg' \( -exec sh -c "export E={}; inkscape -z -f \$E -e \${E%svg}png" \; -exec rm {} \; \)
824 size
825 fi
827 #####
829 if [ "$OP" = "yes" ]; then
830 echo -n "Optipng... "
831 # re-compress png files
832 find $TO -type f -iname '*.png' -exec optipng -quiet -strip all $PNGOPT {} \;
833 size
834 fi
836 #####
838 if [ "$SL" = "yes" ]; then
839 echo -n "Symlinks... "
840 MD5FILE=$(mktemp); find $TO -type f -exec md5sum {} \; | sort > $MD5FILE
841 # substitute repeated files by symlinks
842 for md in $(uniq -d -w32 $MD5FILE | cut -c1-32); do
843 make_symlinks $(grep $md $MD5FILE | cut -c35-)
844 done
845 rm "$MD5FILE"
846 # make all symlinks relative
847 SL=$(symlinks -crs $TO 2> /dev/null)
848 size
849 fi
851 #####
853 echo -n 'Make index.theme... '
854 {
855 echo "[Icon Theme]"
856 echo "Name=$NAME"
858 echo -n "Directories="
859 cd "$TO"
860 FOLDERS=$(find . -type d -mindepth 2 | sort | sed "s|^\./||g")
861 FOLDERS_COMMA=$(echo "$FOLDERS" | tr '\n' ',')
862 echo ${FOLDERS_COMMA%,}
864 for FOLDER in $FOLDERS; do
865 echo
866 echo "[$FOLDER]"
867 echo -n "Size="; echo "$FOLDER" | sed 's|^\([0-9]*\).*|\1|'
868 echo -n "Context="
869 case ${FOLDER#*/} in
870 actions) echo 'Actions' ;;
871 animations) echo 'Animations' ;;
872 apps) echo 'Applications' ;;
873 categories) echo 'Categories' ;;
874 devices) echo 'Devices' ;;
875 emblems) echo 'Emblems' ;;
876 emotes) echo 'Emotes' ;;
877 filesystems) echo 'FileSystems' ;;
878 intl) echo 'International' ;;
879 mimetypes) echo 'MimeTypes' ;;
880 places) echo 'Places' ;;
881 status) echo 'Status' ;;
882 *) echo 'Other' ;;
883 esac
884 echo "Type=Threshold"
885 done
886 } > $TO/index.theme
887 echo 'Done'