Send stacktrace data also to a /tmp file
[geeqie.git] / scripts / modify-downloaded-icons.sh
1 #!/bin/sh
2 #**********************************************************************
3 # Copyright (C) 2023 - The Geeqie Team
4 #
5 # Author: Colin Clark
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #**********************************************************************
21
22 ## @file
23 ## @brief Convert downloaded icons
24 ##
25 ## Rename downloaded icons to Geeqie name
26 ## Invert colors for dark theme and save with "-dark" filename
27 ##
28 ##
29
30 input_array="
31 arrows.png  gq-icon-zoomfillhor https://www.flaticon.com/free-icon/arrows_9847398
32 black-and-white.png gq-icon-grayscale https://www.flaticon.com/free-icon/black-and-white_3099713
33 bookmark.png gq-icon-marks https://www.flaticon.com/free-icon/bookmark_2099170
34 checkbox.png gq-icon-select-invert https://www.flaticon.com/free-icon/checkbox_6948194
35 database.png gq-icon-maintenance https://www.flaticon.com/free-icon/replace_10337081
36 double-arrow-vertical-symbol.png  gq-icon-zoomfillvert https://www.flaticon.com/free-icon/double-arrow-vertical-symbol_54668
37 edit.png gq-icon-rename https://www.flaticon.com/free-icon/edit_1159633
38 error.png  gq-icon-broken https://www.flaticon.com/free-icon/error_3152157
39 exif.png gq-icon-exif https://www.flaticon.com/free-icon/exif_6393981
40 exposure.png gq-icon-exposure https://www.flaticon.com/free-icon/exposure_2214025
41 frame.png gq-icon-select-rectangle https://www.flaticon.com/free-icon/frame_4864813
42 heic.png gq-icon-heic https://www.flaticon.com/free-icon/heic_6393991
43 letter-i.png gq-icon-properties https://www.flaticon.com/free-icon/letter-i_9003911
44 letter-s.png gq-icon-sort https://www.flaticon.com/free-icon/letter-s_5697524
45 move-right.png gq-icon-move https://www.flaticon.com/free-icon/move-right_10515829
46 panorama.png gq-icon-panorama https://www.flaticon.com/free-icon/panorama_8207268
47 paper-pin.png gq-icon-float https://www.flaticon.com/free-icon/paper-pin_3378283
48 paper.png gq-icon-hidetools https://www.flaticon.com/free-icon/paper_11028332
49 pdf.png gq-icon-pdf https://www.flaticon.com/free-icon/pdf_201153
50 replace.png gq-icon-split-pane-sync https://www.flaticon.com/free-icon/replace_10337081
51 restore-down.png gq-icon-select-none https://www.flaticon.com/free-icon/restore-down_4903563
52 rotate.png gq-icon-original https://www.flaticon.com/free-icon/rotate_764623
53 select.png  gq-icon-select-all https://www.flaticon.com/free-icon/select_7043937
54 thumbnails-1.png gq-icon-collection https://www.flaticon.com/free-icon/thumbnails_204593
55 thumbnails.png gq-icon-thumb https://www.flaticon.com/free-icon/thumbnails_204592
56 transform.png gq-icon-draw-rectangle https://www.flaticon.com/free-icon/rectangle_3496559
57 two-clockwise-circular-rotating-arrows-circle.png gq-icon-rotate-180 https://www.flaticon.com/free-icon/two-clockwise-circular-rotating-arrows-circle_54529
58 unknown.png gq-icon-unknown https://www.flaticon.com/free-icon/unknown_9166172
59 video.png gq-icon-video https://www.flaticon.com/free-icon/video_10260807
60 xmp.png gq-icon-metadata https://www.flaticon.com/free-icon/xmp_10260892
61 zip.png gq-icon-archive-file https://www.flaticon.com/free-icon/zip_201199
62 "
63
64 i=0
65 for file in $input_array
66 do
67         if [ "$i" -eq 0 ]
68         then
69                 input="$HOME/Downloads/$file"
70                 i=$((i + 1))
71         else
72                 if [ "$i" -eq 1 ]
73                 then
74                         output="$file"
75                         cp "$input" "./src/icons/$output.png"
76                         convert "$input" -fill '#ffffff' -opaque black "./src/icons/$output-dark.png"
77                         i=$((i + 1))
78                 else
79                         i=0
80                 fi
81         fi
82 done