question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linux icons issue

See original GitHub issue
  • Version: 20.0.4
  • Target: deb, AppImage

No matter what I try I cannot set an icon on Linux. Building from a macOS Sierra. I have dir’s customized:

"directories": {
      "buildResources": "./build_res",
      "output": "./build",
      "app": "./dist"
    }

I’ve tried setting

"linux": {
      "icon": "..."
}

to all imaginable values, copying all icon folders to different locations in the root and build_res and I still get a question mark icon in Ubuntu 16.04.

I have an .icns file in ./build_res/icon.icns.

Is there a workaround? Or a fix?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:43 (14 by maintainers)

github_iconTop GitHub Comments

11reactions
nukeopcommented, Feb 13, 2018

I can’t set an icon on Linux either, using any of the methods listed in the docs. Implicit conversion from .icns, setting it explicitly as icon.png or 1024x1024.png, or setting buildResources, or providing icon names, or copying the icons to all imaginable locations, all these methods just don’t work. I’m using 20.0.4 now.

8reactions
yuya-occommented, Mar 30, 2018

Investigation

I investigated with my simplest config.

  • Ubuntu: 16.04
  • electron-builder: 20.8.2
  • app-builder-bin-linux: 1.8.3 (app-builder --version shows 1.8.2)
/home/yuya-oc/git/electron-scaffold
├── build
│   ├── icon.icns
│   ├── icon.ico
│   └── icon.png
├── index.html
├── main.js
└── package.json
electron-builder --config.linux.target=deb --arch=x64

In this case, internally app-builder is executed with following args:

icon --format set --root /home/yuya-oc/git/electron-scaffold/build --root /home/yuya-oc/git/electron-scaffold --out /home/yuya-oc/git/electron-scaffold/dist/.icon-set --input icons --input icon.icns --input /home/yuya-oc/git/electron-builder/packages/electron-builder-lib/templates/linux/electron-icons

Then rawResult indicates the icon size is 0x0.

{"icons":[{"file":"/home/yuya-oc/git/electron-scaffold/build/icon.png","size":0}]}

https://github.com/electron-userland/electron-builder/blob/37014be76e2ea8e5183a68cc4a56ffca31c08df5/packages/electron-builder-lib/src/platformPackager.ts#L609

So the icon.png is included into .deb as /usr/share/icons/hicolor/0x0/apps/${packager.executableName}.png. I think this is the reason why the linux icon did not appear for me. https://github.com/electron-userland/electron-builder/blob/37014be76e2ea8e5183a68cc4a56ffca31c08df5/packages/electron-builder-lib/src/targets/fpm.ts#L204-L206

Workaround

icns

When I remove build/icon.png, dist/.icon-set is correctly generated from build/icon.icns. However we can’t use different icon from macOS.

png

By following the guide, I renamed build/icon.png to build/icons/512.png. The icon is included as /usr/share/icons/hicolor/512x512/apps/${packager.executableName}.png and I can see it on Linux.

Expected

As mentioned at previous comment, need to clarify recommended way and how icon is chosen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix icons that never change their look whatever theme ...
On ArcoLinu we can fix this by typing the following command in the terminal sudo hardcode-fixer. This will change a hardcode path like....
Read more >
Desktop icons changed - need to fix [problem rectified, cause ...
You may accidentality have changed your icon theme as well. First check whether you cannot bring the regular icons back through the appearance ......
Read more >
Icons - ArchWiki
Manually · Firstly, find and download your desired icon pack. · Then navigate to the directory which contains the icon pack and extract...
Read more >
Fix Your Linux Icons in Chrome OS - CrosExperts
First, go to your Files app and make your way to the Linux files. There, make sure that “Show hidden files” is checked....
Read more >
How to fix missing icons, files and folders in Kali Linux
How to fix missing icons, files and folders in Kali Linux So, Aaj is video mein hum dekhenge ki kis tarah se hum...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found