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