Browse Source

Merge pull request #882 from meriadec/linux-icon

Linux icon
master
Gaëtan Renaudeau 7 years ago
committed by GitHub
parent
commit
8b0bdf5fd9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. BIN
      build/icon.icns
  2. 6
      electron-builder.yml
  3. 3
      scripts/compile.sh
  4. 13
      scripts/dist.sh
  5. 6
      src/main/app.js
  6. BIN
      static/images/linux-app-icon-512x512.png

BIN
build/icon.icns

Binary file not shown.

6
electron-builder.yml

@ -12,6 +12,9 @@ mac:
- dmg
- zip
appImage:
systemIntegration: doNotAsk
linux:
asarUnpack:
- node_modules/@ledgerhq/ledger-core
@ -21,9 +24,6 @@ linux:
- target: AppImage
arch:
- x64
- target: tar.gz
arch:
- x64
win:
artifactName: ${name}-${version}-${os}-${arch}.${ext}

3
scripts/compile.sh

@ -4,8 +4,9 @@ set -e
export GIT_REVISION=`git rev-parse HEAD`
export SENTRY_URL=https://db8f5b9b021048d4a401f045371701cb@sentry.io/274561
export JOBS=max
rm -rf ./node_modules/.cache dist
JOBS=max yarn
yarn
NODE_ENV=production yarn run webpack-cli --mode production --config webpack/internals.config.js
NODE_ENV=production yarn run electron-webpack

13
scripts/dist.sh

@ -1,3 +1,16 @@
#!/bin/bash
# hilarious fix: to make linux icon we have to remove icon.png from build folder
# some context:
# - https://github.com/electron-userland/electron-builder/issues/2577
# - https://github.com/electron-userland/electron-builder/issues/2269
if [[ `uname` == 'Linux' ]]; then
mv build/icon.png /tmp
fi
yarn compile && DEBUG=electron-builder electron-builder
# hilarious fix continuation: put back the icon where it was
if [[ `uname` == 'Linux' ]]; then
mv /tmp/icon.png build
fi

6
src/main/app.js

@ -11,6 +11,7 @@ import {
import menu from 'main/menu'
import db from 'helpers/db'
import { i } from 'helpers/staticPath'
import { terminateAllTheThings } from './terminator'
@ -65,6 +66,11 @@ const saveWindowSettings = window => {
}
const defaultWindowOptions = {
// Linux require window to have icon to be correctly displayed
// in docks, when using <C-tab>, etc.
// see https://github.com/electron-userland/electron-builder/issues/2269<Paste>
icon: i('linux-app-icon-512x512.png'),
backgroundColor: '#fff',
webPreferences: {
devTools,

BIN
static/images/linux-app-icon-512x512.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Loading…
Cancel
Save