Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 2f9a75b

Browse files
authored
Merge pull request #291 from TriliumNext/feature/new_icon
New icon
2 parents c0a2688 + 2d7ffaf commit 2f9a75b

35 files changed

+692
-117
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
paths-ignore:
99
- 'docs/**'
1010
- 'bin/**'
11+
workflow_dispatch:
1112

1213
concurrency:
1314
group: ${{ github.workflow }}-${{ github.ref }}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ data-test/
1616
tmp/
1717
.eslintcache
1818

19-
out/
19+
out/
20+
21+
images/app-icons/png/16x16.png
22+
images/app-icons/png/32x32.png
23+
images/app-icons/png/512x512.png
24+
images/app-icons/png/1024x1024.png
25+
images/app-icons/mac/*.png

bin/create-icons.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
3+
if ! command -v magick &> /dev/null; then
4+
echo "This tool requires ImageMagick to be installed in order to create the icons."
5+
exit 1
6+
fi
7+
8+
if ! command -v inkscape &> /dev/null; then
9+
echo "This tool requires Inkscape to be render sharper SVGs than ImageMagick."
10+
exit 1
11+
fi
12+
13+
if ! command -v icnsutil &> /dev/null; then
14+
echo "This tool requires icnsutil to be installed in order to generate macOS icons."
15+
exit 1
16+
fi
17+
18+
script_dir=$(realpath $(dirname $0))
19+
cd "${script_dir}/../images/app-icons"
20+
inkscape -w 180 -h 180 "../icon-color.svg" -o "./ios/apple-touch-icon.png"
21+
22+
# Build PNGs
23+
inkscape -w 128 -h 128 "../icon-color.svg" -o "./png/128x128.png"
24+
inkscape -w 256 -h 256 "../icon-color.svg" -o "./png/256x256.png"
25+
inkscape -w 256 -h 256 "../icon-purple.svg" -o "./png/256x256-dev.png"
26+
27+
# Build Mac .icns
28+
declare -a sizes=("16" "32" "512" "1024")
29+
for size in "${sizes[@]}"; do
30+
inkscape -w $size -h $size "../icon-color.svg" -o "./png/${size}x${size}.png"
31+
done
32+
33+
mkdir -p fakeapp.app
34+
npx iconsur set fakeapp.app -l -i "png/1024x1024.png" -o "mac/1024x1024.png" -s 0.8
35+
declare -a sizes=("16x16" "32x32" "128x128" "512x512")
36+
for size in "${sizes[@]}"; do
37+
magick "mac/1024x1024.png" -resize "${size}" "mac/${size}.png"
38+
done
39+
icnsutil compose -f "mac/icon.icns" ./mac/*.png
40+
41+
# Build Windows icon
42+
magick -background none "../icon-color.svg" -define icon:auto-resize=16,32,48,64,128,256 "./win/icon.ico"
43+
44+
# Build Squirrel splash image
45+
magick "./png/256x256.png" -background "#ffffff" -gravity center -extent 640x480 "./win/setup-banner.gif"

db/demo.zip

-5.3 KB
Binary file not shown.
-8.89 KB
Loading

images/app-icons/mac/icon.icns

46.7 KB
Binary file not shown.

images/app-icons/png/128x128.png

-9.29 KB
Loading

images/app-icons/png/16x16-bw.png

-706 Bytes
Binary file not shown.

images/app-icons/png/16x16.png

-782 Bytes
Binary file not shown.

images/app-icons/png/24x24.png

-972 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)