Skip to content

Commit 992559e

Browse files
committed
Improve icon usage
1 parent 9411dc5 commit 992559e

File tree

10 files changed

+39
-14
lines changed

10 files changed

+39
-14
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
- name: Run electron-builder
106106
working-directory: ${{ matrix.edition }}-src
107107
env:
108-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109109
NOTION_REPACKAGED_EDITION: ${{ matrix.edition }}
110110
run: npx electron-builder --${{ matrix.target }} -c ../electron-builder.js
111111

assets/enhancer-icons/128x128.png

5.12 KB
Loading

assets/enhancer-icons/16x16.png

623 Bytes
Loading

assets/enhancer-icons/256x256.png

10.5 KB
Loading

assets/enhancer-icons/32x32.png

1.27 KB
Loading

assets/enhancer-icons/48x48.png

1.97 KB
Loading
File renamed without changes.

electron-builder.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,25 @@ const editionEnv = process.env.NOTION_REPACKAGED_EDITION || 'vanilla';
33
module.exports = {
44
asar: editionEnv === 'vanilla',
55
productName: editionEnv === 'vanilla' ? 'Notion' : 'Notion Enhanced',
6+
extraMetadata: {
7+
description:
8+
editionEnv === 'vanilla'
9+
? 'The all-in-one workspace for your notes and tasks'
10+
: 'The all-in-one workspace for your notes and tasks, but enhanced',
11+
},
612
appId: 'com.github.notion-repackaged',
713
protocols: [{ name: 'Notion', schemes: ['notion'] }],
814
win: {
15+
icon: 'icon.ico',
916
target: ['nsis', 'zip'],
1017
},
18+
nsis: {
19+
installerIcon: 'icon.ico',
20+
oneClick: false,
21+
perMachine: false,
22+
},
1123
mac: {
24+
icon: 'icon.icns',
1225
category: 'public.app-category.productivity',
1326
target: [
1427
{
@@ -21,11 +34,8 @@ module.exports = {
2134
},
2235
],
2336
},
24-
nsis: {
25-
oneClick: false,
26-
perMachine: false,
27-
},
2837
linux: {
38+
icon: 'icon.icns',
2939
category: 'Office;Utility;',
3040
maintainer: '[email protected]',
3141
mimeTypes: ['x-scheme-handler/notion'],
@@ -34,11 +44,5 @@ module.exports = {
3444
},
3545
target: ['AppImage', 'deb', 'rpm', 'pacman', 'zip'],
3646
},
37-
extraMetadata: {
38-
description:
39-
editionEnv === 'vanilla'
40-
? 'The all-in-one workspace for your notes and tasks'
41-
: 'The all-in-one workspace for your notes and tasks, but enhanced',
42-
},
4347
publish: ['github'],
4448
};

scripts/build-locally.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ npm install
2121
log "Install electron and electron-builder..."
2222
npm install electron@11 electron-builder --save-dev
2323

24+
export NOTION_REPACKAGED_EDITION=enhanced
25+
2426
log "Running electron-builder..."
2527
node_modules/.bin/electron-builder \
2628
--linux pacman \
27-
--config $WORKSPACE_DIR/electron-builder.yaml
29+
--config $WORKSPACE_DIR/electron-builder.js
2830

2931
popd > /dev/null

scripts/enhance-src.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ workspace-dir-pushd
77

88
check-cmd jq
99
check-cmd git
10+
check-cmd convert
11+
check-cmd png2icns
1012

1113
if [ -d "${NOTION_ENHANCED_SRC_NAME}" ]; then
1214
log "Removing already enhanced sources..."
@@ -52,12 +54,29 @@ for patchable_file in $(find . -type d \( -path ./${NOTION_EMBEDDED_NAME} -o -pa
5254
echo "${rel_loader_require}" >> $patchable_file
5355
done
5456

55-
log "Swapping the original icon with the enhancer's one..."
57+
log "Swapping out vanilla icons..."
5658
mkdir -p vanilla
5759
mv icon.icns vanilla/icon.icns
5860
mv icon.png vanilla/icon.png
5961
mv icon.ico vanilla/icon.ico
6062

61-
cp "${WORKSPACE_DIR}/assets/notion-enhancer-512.png" icon.png
63+
enhancer_icons="${WORKSPACE_DIR}/assets/enhancer-icons"
64+
65+
cp "${enhancer_icons}/512x512.png" icon.png
66+
67+
log "Converting icon to multi-size ico for Windows"
68+
# http://www.imagemagick.org/Usage/thumbnails/#favicon
69+
convert "${enhancer_icons}/512x512.png" -resize 256x256 \
70+
-define icon:auto-resize="256,128,96,64,48,32,16" \
71+
icon.ico
72+
73+
log "Converting icon to multi-size for Mac and Linux"
74+
# https://askubuntu.com/questions/223215/how-can-i-convert-a-png-file-to-icns
75+
png2icns icon.icns \
76+
"${enhancer_icons}/512x512.png" \
77+
"${enhancer_icons}/256x256.png" \
78+
"${enhancer_icons}/128x128.png" \
79+
"${enhancer_icons}/32x32.png" \
80+
"${enhancer_icons}/16x16.png"
6281

6382
popd > /dev/null

0 commit comments

Comments
 (0)