wok annotate make-slitaz-icons/stuff/mksit.sh @ rev 18545

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