How to use electron-packager to create a custom icon in Linux?


Following this tutorial:

I did this: electron-packager . MyApp --platform=linux --arch=x64 --version=0.37.2 && cp icon.png MyApp-linux-x64/resources/atom.png

The icon is saved into the resources folder, but the icon doesn’t show in my Ubuntu left panel (I just see the default cog).

What the correct way of setting up the icon for Linux?


I also tried this: var mainWindow = new BrowserWindow({ icon: 'file://' + __dirname + '/resources/atom.png',

No luck.


Here’s a screenshot of the whole thing:


I can’t read your code on your image therefore I can’t see how your post is really helpful not showing what you did to achieve it.


let win = new BrowserWindow({width: 800, height: 600,
icon: __dirname + ‘/ball.png’ });