- Use this code block to install or upgrade the application.
mkdir notion && cd notion && \\
curl -OL <https://www.notion.so/desktop/windows/download> && \\
7z e download '$PLUGINSDIR/app-64.7z' && \\
7z e app-64.7z resources/app.asar && \\
npx --yes @electron/asar extract app.asar app && \\
sqlite3=$(node --print "require('./app/package.json').dependencies['better-sqlite3']") ; \\
electron=$(node --print "require('./app/package.json').devDependencies['electron']") ; \\
npm pack better-sqlite3@$sqlite3 && \\
tar xf better-sqlite3-*.tgz && \\
cd package && \\
npm install && \\
npx node-gyp rebuild --target=$electron --arch=x64 --dist-url=https://electronjs.org/headers && \\
cp build/Release/better_sqlite3.node ../app/node_modules/better-sqlite3/build/Release && \\
cd ../app && \\
mv icon.ico icon.png && \\
npx --yes electron-builder --linux appimage --config.npmRebuild=false && \\
mkdir ~/.local/share/applications/ ; \\
killall -w notion ; \\
cp dist/Notion-*.AppImage ~/.local/share/applications/Notion.AppImage && \\
mkdir -p ~/.local/share/icons/hicolor/256x256/apps ; \\
cp icon.png ~/.local/share/icons/hicolor/256x256/apps/notion.png && \\
cd ../.. && rm -rf notion && \\
cat > ~/.local/share/applications/Notion.desktop << 'EOF'
[Desktop Entry]
Name=Notion
Exec=sh -c "killall notion ; ~/.local/share/applications/Notion.AppImage"
Icon=notion
Terminal=false
EOF