Linux .deb icon requires packing/making for MacOS
See original GitHub issue- Electron-Builder Version: 22.11.11
- Node Version: v16.15.0
- Electron Version: v19.0.1
- Electron Type (current, beta, nightly):current
- Target: Linux .deb
My electron-builder.config.json
looks something like this:
{
"appId": "com.yourdoamnin.yourapp",
"directories": {
"buildResources": "resources"
},
"files": [
"assets/**/*",
"build/**/*",
"capacitor.config.*",
"app/**/*"
],
"linux": {
"target": ["deb"],
"category": "Education",
"icon": "dist/.icon-icns/icon.icns"
},
"mac": {
"target": ["zip"],
"icon": "assets/appIcon.png"
},
"win": {
"icon": "assets/appIcon.ico"
}
}
My package.json
scripts look like this:
"scripts": {
"build": "tsc",
"electron.start-live": "node ./live-runner.js",
"electron.start": "npm run build && electron --inspect=5858 ./",
"electron.pack": "npm run build && electron-builder build -lmw --dir -c ./electron-builder.config.json",
"electron.make": "npm run build && electron-builder build -l -c ./electron-builder.config.json",
"postinstall": "electron-builder install-app-deps"
},
assets/appIcon.png
is a valid file.
If I run electron.make
, it never generates the .icns file whether I set linux.icon
to undefined
, "assets/appIcon.png"
, or "dist/.icon-icns/icon.icns"
. So when I install the generated .deb file, it is either the blank gear icon or the default electron icon.
However, if I run electon.pack
, it will create the .icns file because it builds for mac, then if I set linux.icon
to "dist/.icon-icns/icon.icns"
and run electron.make
again, the installed .deb file will have the correct icon. Why should I have to pack it for mac in order for the linux debian icon to work? This seems like an undesireable workflow.
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
Linux .deb icon requires packing/making for MacOS - GitHub
A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box - Linux...
Read more >Icons - electron-builder
Linux icon set will be generated automatically based on the macOS icns file or common icon.png . Or you can put them into...
Read more >How do I set icon for Electron app on Linux(Ubuntu, ...)?
I have successfully set icon for my electron app on MacOS and Windows OS with the icon file in the build folder, configuration...
Read more >Iconset - Best Icons Organizer & Manager for Mac and Windows
Best SVG vector icons, icon sets & icon packs organizer and manager app for designers, developers and teams. Works on both macOS and...
Read more >How to Make Ubuntu Look Like macOS in 5 Easy Steps
Don't agree? See how you can give your Ubuntu Linux a macOS makeover. ... You'll need it to change the themes and icons....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes that is what I meant I guess, I just used an online icon generator lol
Haha I agree, I’m not a contributor just trying to help 😃
I did not know that, thank you I’ve learned something new 👍
Well I see that just now, I guess that I didn’t know they were generating that icons in that case,
I would like to point out that when I made an app for Mac once using xCode it did not let me put a png as the favicon, and I had to generate the .icns manually using a terminal command that was only available in mac os to convert a png to icns, did that years ago
Are you building from Windows, Mac or Linux?
this article talks about cross platform builds and how you can only build from mac to windows but not vice versa I think…
https://www.electron.build/multi-platform-build
Anywho good luck 😄
@burgil yep, that’s my conclusion as well.
But just to be super clear for anyone who comes across this issue, while this extra information about building for MacOS is helpful, it is not relevant to my original question.
On Linux you can build the unpacked MacOS files with
--dir
, which generates the.icns
, which the build for Linux can then use to generate its PNG files. But if you want to generate only for Linux, there is no option to leave out the MacOS dir build and generate all the necessary Linux icons automatically from a single PNG.There are workarounds, but obviously they’re not an ideal workflow.