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

只愿长相守 提交于 2019-12-12 03:35:14

问题


Following this tutorial:

https://www.youtube.com/watch?v=dz5SnmBzBXc

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?

EDIT:

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

No luck.

EDIT 2

Here's a screenshot of the whole thing:


回答1:


Try this command: electron-packager . MyApp --platform=linux --arch=x64 --version=0.37.2 --icon=<path/to/your-icon-name>



来源:https://stackoverflow.com/questions/36041127/how-to-use-electron-packager-to-create-a-custom-icon-in-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!