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

busybox: update configs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Sep 01 11:04:25 2020 +0000 (2020-09-01)
parents 47df087cffcf
children
line source
1 #!/bin/sh
2 # Make SliTaz icon theme
3 # Aleksej Bobylev <al.bobylev@gmail.com>, 2014-2017
4 # (Started in November 2014)
6 VERSION="180314"
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 be 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 +rs -rs Whether to use Rsvg to convert svg icons to png (default: +rs)
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/" -e "/scalable/")
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 # Multiple choice. Choose one with /$SIZE/ in the path.
77 # Or choose other with /$SIZEx$SIZE. Or choose just the first one.
78 FINDICONorig="$FINDICON"
79 FINDICON="$(echo "$FINDICONorig" | grep "/$SIZE/" | head -n1)"
80 if [ -z "$FINDICON" ]; then
81 FINDICON="$(echo "$FINDICONorig" | grep "/${SIZE}x${SIZE}/" | head -n1)"
82 if [ -z "$FINDICON" ]; then
83 FINDICON="$(echo "$FINDICONorig" | head -n1)"
84 fi
85 fi
86 fi
87 mkdir -p $TO/${SIZE}x${SIZE}/$CATEGORY
89 BASE_FINDICON="$(basename $FINDICON .png)"
90 BASE_FINDICON="$(basename $BASE_FINDICON .svg)"
92 if [ "$1" == "$BASE_FINDICON" ]; then
93 colored 32 "+ $1($SIZE)"
94 else
95 colored 34 "+ $1($SIZE) <= $(basename $FINDICON)"
96 fi
98 EXT=${FINDICON##*.}
99 cp -aL $FROM/$FINDICON $TO/${SIZE}x${SIZE}/$CATEGORY/$1.$EXT
101 FOUND='yes'
102 break
103 fi
104 done
105 if [ -z "$FOUND" ]; then
106 colored 31 "- $1($SIZE) NOT FOUND!"
107 fi
108 done
109 }
112 # Maybe copy stock icon
114 s() {
115 if [ "${BASED_ON%%-*}" != "Faenza" ]; then
116 c $@
117 else
118 echo ". $1"
119 fi
120 }
123 # Return shortest line
125 shortest_line() {
126 S=$1; shift
127 for L in $@; do
128 [ "${#L}" -lt "${#S}" ] && S="$L"
129 done
130 echo "$S"
131 }
134 # Replace the same files by symlinks, $@ - list of identical files
136 make_symlinks() {
137 S=$(shortest_line $@)
138 for file in $@; do
139 [ "$S" != "$file" ] && ln -sf $S $file
140 done
141 }
144 # Calculate size in bytes
146 size() {
147 echo -n "size: "
148 find "$TO" -type f -exec stat -c %s {} \; | awk 'BEGIN{SUM=0}{SUM+=$1}END{print SUM}'
149 }
152 # Print out category
154 echo_cat() {
155 echo
156 colored 35 $CATEGORY
157 colored 35 $(echo -n $CATEGORY | tr -c '' '-')
158 }
164 case "$1" in
165 -h|--help) usage; exit 0 ;;
166 -V|--version) echo "$(basename $0) v. $VERSION"; exit 0 ;;
167 esac
170 # Default parameters:
172 RS='yes'; OP='yes'; SL='yes'; PNGOPT=''; SUBS=''; color='yes'
174 while [ "x$1" != "x" ]; do
175 case "$1" in
176 -f) FROM="$2"; shift; BASED_ON="$(basename ${FROM%/})" ;;
177 -t) TO="$2"; shift; NAME="$(basename ${TO%/})" ;;
178 -s) SUBS="$2"; shift; if [ -d "$SUBS" ]; then SUBS="${SUBS%/}/$BASED_ON.sub"; fi ;;
179 -n) NAME="$2"; shift ;;
180 -rs) RS='no' ;;
181 +rs) RS='yes' ;;
182 -op) OP='no' ;;
183 +op) OP='yes' ;;
184 -sl) SL='no' ;;
185 +sl) SL='yes' ;;
186 -opmax) PNGOPT="-o7 -zm1-9" ;;
187 -nocolor) color='no' ;;
188 esac
189 shift
190 done
192 if [ "x$FROM" == "x" -o "x$TO" == "x" ]; then
193 echo "There are no required parameters (-f or -t)!"; exit 1
194 fi
196 echo "Check components..."
197 if [ $RS == 'yes' ]; then
198 echo -n "rsvg-convert: "
199 if [ -x "$(which rsvg-convert)" ]; then
200 echo "$(which rsvg-convert)"
201 else
202 colored 31 "not found! Force '-rs'"; RS='no'
203 fi
204 fi
205 if [ $OP == 'yes' ]; then
206 echo -n "optipng : "
207 if [ -x "$(which optipng)" ]; then
208 echo "$(which optipng)"
209 else
210 colored 31 "not found! Force '-op'"; OP='no'
211 fi
212 fi
213 echo -n "symlinks : "
214 if [ -x "$(which symlinks)" ]; then
215 echo "$(which symlinks)"
216 else
217 colored 31 "not found! Abort."; exit 1
218 fi
219 echo
221 echo "Options: Rsvg=\"$RS\" Optipng=\"$OP\" Symlinks=\"$SL\""
222 echo "From: \"$FROM\""
223 echo "To: \"$TO\""
224 echo "Subs: \"$SUBS\""
225 echo "Name: \"$NAME\""
226 echo
229 #rm -rf $TO
231 # make files list
232 ICONSLIST=$(mktemp)
233 find $FROM -type f -o -type l > $ICONSLIST
239 #########################
240 # Standard Action Icons #
241 #########################
242 CATEGORY='actions'; SIZES='16'; echo_cat
244 c address-book-new
245 c application-exit dialog-close # gtk_stock 16,24; Transmission (GTK+3) needs it # elementary hack
246 c appointment-new
247 c call-start
248 c call-stop process-stop # elementary hack
249 c contact-new
250 s document-new # gtk_stock 16,24
251 c document-open # gtk_stock 16,24; Transmission (GTK+3) needs it
252 s document-open-recent # gtk_stock 16,24
253 c document-page-setup
254 s document-print # gtk_stock 16,24
255 s document-print-preview # gtk_stock 16,24
256 s document-properties # gtk_stock 16,24
257 s document-revert # gtk_stock 16,24
258 s document-save # gtk_stock 16,24
259 s document-save-as document-save # gtk_stock 16,24 # elementary hack
260 c document-send document-export # elementary hack
261 c edit-clear remove # gtk_stock 16,24; Yad:tazbox new-file needs it # elementary hack
262 c edit-copy # gtk_stock 16,24; Transmission (GTK+3) needs it
263 s edit-cut # gtk_stock 16,24
264 c edit-delete # gtk_stock 16,24; Transmission (GTK+3) needs it
265 s edit-find # gtk_stock 16,24
266 s edit-find-replace edit-find # gtk_stock 16,24 # elementary hack
267 s edit-paste # gtk_stock 16,24
268 s edit-redo # gtk_stock 16,24
269 c edit-select-all # gtk_stock 16,24; Transmission (GTK+3) needs it
270 s edit-undo # gtk_stock 16,24
271 c folder-new
272 s format-indent-less # gtk_stock 16,24
273 s format-indent-more # gtk_stock 16,24
274 s format-justify-center # gtk_stock 16,24
275 s format-justify-fill # gtk_stock 16,24
276 s format-justify-left # gtk_stock 16,24
277 s format-justify-right # gtk_stock 16,24
278 c format-text-direction-ltr
279 c format-text-direction-rtl
280 s format-text-bold # gtk_stock 16,24
281 s format-text-italic # gtk_stock 16,24
282 s format-text-underline # gtk_stock 16,24
283 s format-text-strikethrough # gtk_stock 16,24
284 s go-bottom # gtk_stock 16,24
285 c go-down # gtk_stock 16,24 but Yad:scp-box needs it
286 c go-first # gtk_stock 16,24
287 s go-home # gtk_stock 16,24
288 s go-jump # gtk_stock 16,24
289 c go-last # gtk_stock 16,24
290 c go-next # gtk_stock 16,24
291 c go-previous # gtk_stock 16,24
292 s go-top # gtk_stock 16,24
293 c go-up # gtk_stock 16,24 but Yad:scp-box needs it
294 c help-about # gtk_stock 16,24; Transmission (GTK+3) needs it
295 c help-contents # gtk_stock 16,24; Transmission (GTK+3) needs it
296 c help-faq help-hint # elementary hack
297 c insert-image
298 c insert-link
299 c insert-object
300 c insert-text
301 c list-add # gtk_stock 16,24; Transmission (GTK+3) needs it
302 c list-remove # gtk_stock 16,24; Transmission (GTK+3) needs it
303 c mail-forward
304 c mail-mark-important
305 c mail-mark-junk
306 c mail-mark-notjunk
307 c mail-mark-read
308 c mail-mark-unread
309 c mail-message-new
310 c mail-reply-all
311 c mail-reply-sender mail-reply
312 c mail-send
313 c mail-send-receive
314 c media-eject list-remove # Matrilineare hack
315 c media-playback-pause # gtk_stock 16,24 but Audacious needs it
316 c media-playback-start # gtk_stock 16,24 but Audacious needs it
317 c media-playback-stop # gtk_stock 16,24 but Audacious needs it
318 s media-record # gtk_stock 16,24
319 s media-seek-backward go-previous # gtk_stock 16,24 # Matrilineare hack
320 s media-seek-forward go-next # gtk_stock 16,24 # Matrilineare hack
321 c media-skip-backward # gtk_stock 16,24 but Audacious needs it
322 c media-skip-forward # gtk_stock 16,24 but Audacious needs it
323 c object-flip-horizontal
324 c object-flip-vertical
325 c object-rotate-left
326 c object-rotate-right
327 s process-stop # gtk_stock 16,24
328 c system-lock-screen lock # Matrilineare hack
329 #c system-log-out contact-new # Matrilineare hack
330 c system-run # gtk_stock 16,24; Transmission (GTK+3) needs it
331 c system-search find # Matrilineare hack
332 c system-reboot system-run # Matrilineare hack
333 c system-shutdown system-shutdown-panel # Matrilineare hack
334 s tools-check-spelling # gtk_stock 16,24
335 s view-fullscreen # gtk_stock 16,24
336 c view-refresh # gtk_stock 16,24 but Yad:tazbox manage-i18n needs it
337 s view-restore # gtk_stock 16,24
338 s view-sort-ascending # gtk_stock 16,24
339 s view-sort-descending # gtk_stock 16,24
340 c window-close # gtk_stock 16,20,24; Transmission (GTK+3) needs it
341 c window-new list-add
342 s zoom-fit-best # gtk_stock 16,24
343 s zoom-in # gtk_stock 16,24
344 s zoom-original # gtk_stock 16,24
345 s zoom-out # gtk_stock 16,24
346 #---------------------------
347 # PCManFM panel and menu
348 c tab-new
349 c view-choose preferences-desktop
350 c view-filter
351 c view-sidetree
353 c gtk-execute # LXPanel menu: run
354 c system-shutdown-panel-restart # LXPanel menu: logout
355 c gtk-close # Yad close button
356 c gtk-go-forward gtk-go-forward-ltr # tazbox tz Yad dialog
357 c bookmark-new # Midori
358 c empty # Yad:tazbox new-file
359 c extract-archive document-export # tazpkg-box, xarchiver...
360 c package-install # tazpkg-box
362 c system-log-out-panel system-log-out-symbolic # lxpanel logout menu
363 c system-reboot-panel system-restart-symbolic #
364 c system-shutdown-panel system-shutdown-symbolic #
367 SIZES='16 48'
368 c document-new # Yad:tazbox new-file
369 c document-properties # Yad:tazbox locale, tazbox manage-i18n
371 c system-log-out # lxpanel logout menu
372 c system-reboot #
373 c system-shutdown #
376 ############################
377 # Standard Animation Icons #
378 ############################
379 CATEGORY='animations'; SIZES='16'; echo_cat
381 c process-working
385 ##############################
386 # Standard Application Icons #
387 ##############################
388 CATEGORY='apps'; SIZES='16 48'; echo_cat
390 c accessories-calculator
391 c accessories-character-map
392 c accessories-dictionary
393 c accessories-text-editor
394 c help-browser
395 c multimedia-volume-control # audio-volume-high
396 c preferences-desktop-accessibility
397 c preferences-desktop-font
398 c preferences-desktop-keyboard # keyboard
399 c preferences-desktop-locale
400 c preferences-desktop-multimedia # applications-multimedia
401 c preferences-desktop-screensaver
402 c preferences-desktop-theme
403 c preferences-desktop-wallpaper
404 c system-file-manager
405 c system-software-install # synaptic
406 c system-software-update # update-notifier
407 c utilities-system-monitor
408 c utilities-terminal
409 c utilities-root-terminal utilities-terminal
410 #-------------------
411 c gcolor2 # gcolor2.desktop
412 c gnome-glchess # chess.desktop
413 c gpicview # gpicview.desktop
414 c tazcalc gnumeric x-office-spreadsheet # tazcalc.desktop
415 c alsaplayer gnome-audio gnome-mplayer # alsaplayer.desktop
416 c leafpad accessories-text-editor # leafpad.desktop
417 c midori # midori.desktop
418 c mtpaint # mtpaint.desktop
419 c xterm # xterm.desktop
420 c burn-box brasero disk-burner # burn-box.desktop
421 c iso-image-burn disk-burner # burn-iso.desktop
422 #c system-log-out # lxde-logout.desktop
423 c sudoku gnome-sudoku # sudoku.desktop
424 c utilities-log-viewer # bootlog.desktop
425 c preferences-desktop-display # lxrandr.desktop
426 c tazbug bug-buddy # tazbug.desktop
427 c applets-screenshooter # mtpaint-grab.desktop
428 c tazwikiss zim accessories-notes # tazwikiss.desktop
429 c system-software-installer software-center software-store # tazpanel-pkgs.desktop
430 c session-properties # lxsession-edit.desktop
431 c terminal # sakura.desktop
432 c user_auth # passwd.desktop
433 c preferences-system-time # tazbox-tz.desktop
434 c text-editor # vi.desktop
435 c drive-harddisk-usb # tazusb-box.desktop
436 c drive-optical # tazlito-wiz.desktop
437 c network-wireless # wifi-box.desktop
438 c gparted # gparted.desktop
439 c epdfview acroread # epdfview.desktop
440 #c menu-editor # libfm-pref-apps.desktop
441 c preferences-system-windows # obconf.desktop
442 c twitter # twitter.desktop
443 c network-server # httpd.desktop
444 c pcmanfm system-file-manager # pcmanfm.desktop
445 c preferences-desktop-default-applications # tazbox tazapps
446 c multimedia-video-player mplayer # tazbox-video.desktop tazbox-video-fullscreen.desktop
449 ###########################
450 # Standard Category Icons #
451 ###########################
452 CATEGORY='categories'; SIZES='16 48'; echo_cat
454 c applications-accessories
455 c applications-development
456 c applications-engineering gnome-do
457 c applications-games
458 c applications-graphics eog # Matrilineare hack
459 c applications-internet web-browser # Matrilineare hack
460 c applications-multimedia
461 c applications-office
462 c applications-other
463 c applications-science
464 c applications-system
465 c applications-utilities
466 c preferences-desktop
467 c preferences-desktop-peripherals
468 c preferences-desktop-personal
469 c preferences-other
470 c preferences-system
471 c preferences-system-network
472 c system-help help-contents
476 #########################
477 # Standard Device Icons #
478 #########################
479 CATEGORY='devices'; SIZES='16'; echo_cat
481 c audio-card
482 c audio-input-microphone gnome-sound-recorder
483 c battery
484 c camera camera-photo
485 c camera-photo
486 c camera-video
487 c camera-web
488 c computer
489 c drive-harddisk
490 c drive-optical
491 c drive-removable-media drive-harddisk-removable # Matrilineare hack
492 c input-gaming
493 c input-keyboard
494 c input-mouse
495 c input-tablet
496 c media-flash drive-removable-media-usb
497 s media-floppy # gtk_stock 16,24
498 s media-optical drive-optical # gtk_stock 16,24 # Matrilineare hack
499 c media-tape
500 c modem
501 c multimedia-player
502 c network-wired
503 c network-wireless
504 c pda
505 c phone ekiga
506 c printer
507 c scanner
508 c video-display
509 #---------------------------
510 c camera camera-photo # Matrilineare hack
512 # Big drive icons on the PCManFM Desktop
513 SIZES='48'
514 c drive-harddisk
515 c drive-optical
516 c drive-removable-media drive-harddisk-removable # Matrilineare hack
517 c video-display # LXPanel - About
520 #########################
521 # Standard Emblem Icons #
522 #########################
523 CATEGORY='emblems'; SIZES='16'; echo_cat
525 c emblem-default
526 c emblem-documents x-office-document # Matrilineare hack
527 c emblem-downloads
528 c emblem-favorite
529 c emblem-important
530 c emblem-mail
531 c emblem-photos image-jpeg
532 c emblem-readonly
533 c emblem-shared
534 c emblem-symbolic-link
535 c emblem-synchronized emblem-ubuntuone-synchronized
536 c emblem-system
537 c emblem-unreadable
541 ##########################
542 # Standard Emotion Icons #
543 ##########################
544 CATEGORY='emotions'; SIZES='16'; echo_cat
546 c face-angel
547 c face-angry
548 c face-cool
549 c face-crying
550 c face-devilish
551 c face-embarrassed
552 c face-kiss
553 c face-laugh
554 c face-monkey
555 c face-plain
556 c face-raspberry
557 c face-sad
558 c face-sick
559 c face-smile
560 c face-smile-big
561 c face-smirk
562 c face-surprise
563 c face-tired
564 c face-uncertain
565 c face-wink
566 c face-worried
570 ################################
571 # Standard International Icons #
572 ################################
574 #flag-aa
575 #flag-RU
576 #flag-UA
580 ############################
581 # Standard MIME Type Icons #
582 ############################
583 CATEGORY='mimetypes'; SIZES='48 16'; echo_cat
584 A='application'
586 # generic icons described in the /usr/share/mime/packages/freedesktop.org.xml
587 c application-x-executable
588 c audio-x-generic
589 c font-x-generic
590 c image-x-generic
591 c package-x-generic
592 c text-html
593 c text-x-generic # gtk_stock 16,24 but...
594 c text-x-generic-template
595 c text-x-script
596 c video-x-generic
597 c x-office-address-book
598 c x-office-calendar
599 c x-office-document
600 c x-office-presentation
601 c x-office-spreadsheet
602 #--------------------------------------
603 # special types
604 c $A-octet-stream
605 c $A-x-zerosize empty
607 # archives
608 c $A-gzip $A-x-gzip
609 c $A-x-compressed-tar
610 c $A-x-7z-compressed
611 c $A-x-ace
612 c $A-x-arc
613 c $A-x-archive
614 c $A-x-rar
615 c $A-x-tar
616 c $A-zip
617 c $A-vnd.ms-cab-compressed $A-x-archive
618 c $A-x-alz $A-x-archive
619 c $A-x-arj
620 c $A-x-bcpio $A-x-archive
621 c $A-x-bzip
622 c $A-x-bzip-compressed-tar
623 c $A-x-lha
624 c $A-x-lzma $A-x-archive
625 c $A-x-lzma-compressed-tar $A-x-archive
626 c $A-x-lzop $A-x-archive
627 c $A-x-tzo $A-x-archive
628 c $A-x-xar $A-x-archive
629 c $A-x-xz $A-x-archive
630 c $A-x-xz-compressed-tar $A-x-archive
632 # packages
633 c $A-vnd.android.package-archive
634 c $A-x-deb
635 c $A-x-java-archive java
636 c $A-x-rpm
637 c $A-x-source-rpm $A-x-rpm
638 c $A-x-tazpkg package-x-generic
640 c $A-illustrator
641 c $A-javascript
642 c $A-mbox
643 c $A-pdf
644 c $A-pgp-signature $A-pgp-keys
645 c $A-rtf
646 c $A-x-apple-diskimage $A-x-cd-image
647 c $A-x-cbr comix
648 c $A-x-cd-image
649 c $A-x-core emblem-danger
650 c $A-x-designer
651 c $A-x-desktop
653 c $A-x-theme
654 c $A-x-emerald-theme $A-x-theme
655 c $A-x-openbox-theme $A-x-theme
657 c $A-x-generic $A-x-executable
658 c $A-x-object $A-octet-stream
659 c $A-x-sharedlib $A-octet-stream
661 c $A-x-gettext-translation preferences-desktop-locale
662 c text-x-gettext-translation preferences-desktop-locale
663 c text-x-gettext-translation-template text-x-generic-template
665 c $A-x-gtk-builder $A-x-glade
666 c $A-x-m4
667 c $A-xml
668 c $A-x-ms-dos-executable
670 c $A-x-perl text-x-script
671 c $A-x-python-bytecode
672 c $A-x-shellscript
673 c $A-x-sqlite3
674 c $A-x-trash
675 c $A-x-x509-ca-cert $A-pgp-keys
677 c audio-mpeg
678 c audio-x-vorbis+ogg
679 c audio-x-wav
680 c image-x-eps
681 c image-x-xcursor ccsm
682 c inode-blockdevice block-device
683 c inode-chardevice chardevice
684 c inode-directory
685 c inode-mount-point drive-removable-media
686 c inode-symlink emblem-symbolic-link
687 c inode-x-generic emblem-generic
688 c text-css
689 c text-plain
690 c text-richtext
691 c text-x-authors
692 c text-x-changelog
693 c text-x-chdr
694 c text-x-copying
695 c text-x-csrc
696 c text-x-install
697 c text-x-log text-x-changelog
698 c text-x-makefile
699 c text-x-markdown text-markdown text-x-source
700 c text-x-patch
701 c text-x-python
702 c text-x-readme
703 c text-x-tazpkg-receipt text-x-script
705 c application-x-shockwave-flash # Midori
706 c unknown # for unknown mimetypes in PCManFM
708 SIZES='16'
709 c package package-x-generic # for Midori: Sidepanel
712 ########################
713 # Standard Place Icons #
714 ########################
715 CATEGORY='places'; SIZES='16 48'; echo_cat
717 c folder # gtk_stock 16,24
718 c folder-remote # gtk_stock 16,24
719 c network-server
720 c network-workgroup
721 c start-here
722 c user-bookmarks
723 c user-desktop # gtk_stock 16,24
724 c user-home # gtk_stock 16,24
725 c user-trash
726 #------------------
727 # PCManFM XDG home sub-folders
728 c folder-documents
729 c folder-download
730 c folder-music
731 c folder-pictures
732 c folder-publicshare
733 c folder-templates
734 c folder-videos
738 #########################
739 # Standard Status Icons #
740 #########################
741 CATEGORY='status'; SIZES='16'; echo_cat
743 c appointment-missed
744 c appointment-soon
745 c battery-caution notification-battery-empty
746 c battery-low notification-battery-low
747 c dialog-error # gtk_stock 48
748 c dialog-information # gtk_stock 16,24,48
749 c dialog-password # gtk_stock 48
750 c dialog-question # gtk_stock 48
751 c dialog-warning # gtk_stock 48
752 c folder-drag-accept
753 c folder-open
754 c folder-visiting
755 c image-loading
756 c image-missing # gtk_stock 16,24
757 c mail-attachment
758 c mail-unread
759 c mail-read
760 c mail-replied
761 c mail-signed
762 c mail-signed-verified
763 c media-playlist-repeat
764 c media-playlist-shuffle
765 c network-error
766 c network-idle # gtk_stock 16,24
767 c network-offline
768 c network-receive
769 c network-transmit
770 c network-transmit-receive
771 c printer-error # gtk_stock 16,24
772 c printer-printing
773 c security-high
774 c security-medium
775 c security-low
776 c sync-error
777 c sync-synchronizing
778 c task-due
779 c task-past-due
780 c user-available
781 c user-away
782 c user-idle
783 c user-offline
784 #c user-trash-full
785 c weather-clear
786 c weather-clear-night
787 c weather-few-clouds
788 c weather-few-clouds-night
789 c weather-fog
790 c weather-overcast
791 c weather-severe-alert
792 c weather-showers
793 c weather-showers-scattered
794 c weather-snow
795 c weather-storm
796 #------------------
797 c system-shutdown-restart-panel # LXPanel logout icon (slitaz-logout.desktop)
799 SIZES="48 16"
800 c user-trash-full # PCManFM desktop
801 c dialog-password # tazbox su default icon
802 c dialog-error # tazbox su error icon
803 c dialog-information
804 c dialog-password
805 c dialog-question
806 c dialog-warning
807 c appointment-soon # Yad:tazbox manage-i18n
809 SIZES="48 16 22"
810 c audio-volume-high # gtk_stock 24
811 c audio-volume-low # gtk_stock 24
812 c audio-volume-medium # gtk_stock 24
813 c audio-volume-muted # gtk_stock 24
814 c software-update-available
815 c software-update-urgent
817 # LXPanel status icons
818 SIZES="22"
819 c gnome-netstatus-0-24 nm-signal-25
820 c gnome-netstatus-25-49 nm-signal-50
821 c gnome-netstatus-50-74 nm-signal-75
822 c gnome-netstatus-75-100 nm-signal-100
823 c gnome-netstatus-disconn network-error
824 c gnome-netstatus-error network-error
825 c gnome-netstatus-idle network-idle
826 c gnome-netstatus-rx network-receive
827 c gnome-netstatus-tx network-transmit
828 c gnome-netstatus-txrx network-transmit-receive
830 # c avatar-default # 16x16 with canvas 22x22: for "slitaz-logout.desktop"
834 #####
836 echo -n "Original "; size
838 #####
840 if [ "$RS" == "yes" ]; then
841 echo -n "Rsvg... "
842 # convert svg to png
843 # leave original file if rsvg-convert fail
844 find $TO -type f -iname '*.svg' \( -exec sh -c "export E={}; rsvg-convert \$E -o \${E%svg}png" \; -exec rm '{}' \; \)
845 size
846 fi
848 #####
850 if [ "$OP" == "yes" ]; then
851 echo -n "Optipng... "
852 # re-compress png files
853 find $TO -type f -iname '*.png' -exec optipng -quiet -strip all $PNGOPT '{}' \;
854 size
855 fi
857 #####
859 if [ "$SL" == "yes" ]; then
860 echo -n "Symlinks... "
861 MD5FILE=$(mktemp); find $TO -type f -exec md5sum '{}' \; | sort > $MD5FILE
862 # substitute repeated files by symlinks
863 for md in $(uniq -d -w32 $MD5FILE | cut -c1-32); do
864 make_symlinks $(grep $md $MD5FILE | cut -c35-)
865 done
866 rm "$MD5FILE"
867 # make all symlinks relative
868 SL=$(symlinks -crs $TO 2> /dev/null)
869 size
870 fi
872 #####
874 echo -n 'Make index.theme... '
875 {
876 echo "[Icon Theme]"
877 echo "Name=$NAME"
879 echo -n "Directories="
880 cd "$TO"
881 FOLDERS=$(find . -type d -mindepth 2 | sort | sed "s|^\./||g")
882 FOLDERS_COMMA=$(echo "$FOLDERS" | tr '\n' ',')
883 echo ${FOLDERS_COMMA%,}
885 for FOLDER in $FOLDERS; do
886 echo
887 echo "[$FOLDER]"
888 echo -n "Size="; echo "$FOLDER" | sed 's|^\([0-9]*\).*|\1|'
889 echo -n "Context="
890 case ${FOLDER#*/} in
891 actions) echo 'Actions' ;;
892 animations) echo 'Animations' ;;
893 apps) echo 'Applications' ;;
894 categories) echo 'Categories' ;;
895 devices) echo 'Devices' ;;
896 emblems) echo 'Emblems' ;;
897 emotes) echo 'Emotes' ;;
898 filesystems) echo 'FileSystems' ;;
899 intl) echo 'International' ;;
900 mimetypes) echo 'MimeTypes' ;;
901 places) echo 'Places' ;;
902 status) echo 'Status' ;;
903 *) echo 'Other' ;;
904 esac
905 echo "Type=Threshold"
906 done
907 } > $TO/index.theme
908 echo 'Done'