electron: Indicator icon missing in Ubuntu 17.04

  • Electron version: multiple
  • Operating system: Ubuntu 17.04

Expected behavior

Electron based apps that provide an indicator icon display the icon

Actual behavior

Indicator icon is not displayed

How to reproduce

I have this issue in several up to date Electron based applications. Such as: Slack, Google Desktop Music Manager, Skype, etc…

The work around of export XDG_CURRENT_DESKTOP=Unity, mentioned in some older issues does work to fix the issue.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 28
  • Comments: 31 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I found another workaround, where you could use the original .desktop shortcuts.

Edit ~/.profile with this line added to the end:

export XDG_CURRENT_DESKTOP=Unity

It should work for about any application that stopped showing an indicator in Ubuntu 17.04 till this problem gets sorted.

Update: This workaround does break the System Settings in Ubuntu, so maybe continue editing the .desktop shortcuts.

Of course this issue is different on Ubuntu 17.10 where we have GNOME now and Ubuntu is using it’s own Indicator GNOME extension and current Electron apps are not able to show an icon.

Any updates on this? Is this bug going to be fixed in the nearest future? Thanks.

Here is your PR.

Seems like a simple enough fix if someone wants to take this one on. Basically just need to add another if condition to this workaround

https://github.com/electron/electron/blob/d0643250f717a9e5d9d4869f72fd5437c88e862f/lib/browser/init.js#L166

Something like:

if (process.platform === 'linux' && ['Pantheon', 'Unity:Unity7'].indexOf(process.env.XDG_CURRENT_DESKTOP) !== -1) {
  process.env.XDG_CURRENT_DESKTOP = 'Unity'
}

I don’t have a 17.04 VM and don’t have the time rn to set one up, if someone with 17.04 can test that fix and PR it in (if it works) that would be great 👍

@whitethunder do you have your app tray icon working on Linux (appimage)? I can’t see anything.

How I resolved fixing the missing icons from windows buttons XFCE4 panel… mostly.

By using seticon, xwininfo in a bash script which really does nothing much but use xwininfo to find the window title, and use a predefined icon path to pass to the window ID returned by xwininfo. NOTE: the seticon get-seticon.sh portion of the script isn’t tested, as installing seticon was difficult to install, until finding this gist from github user unhammer thanks a bunch! xwininfo should be already available, if not it’s easy to install.

…and by mostly sometimes the .desktop file overrides the /bin/bash ~/bin/fix-termius-icon.sh and back to broken icon usually on reboots it seems, but if annoys enough just running the bash script after it’s annoyed me enough. Electron hopefully saves everyone’s sanity, soon.

Specs: Ubuntu 16.04, XFCE4 Win Buttons panel, Slack and Termius SSH ugly default icons.

# configure
WIN_NAME="Termius";
APP_EXEC="/snap/bin/termius-app";
APP_ICON="/snap/termius-app/current/meta/gui/icon.png";

# how long to wait before looking for window title
TIME_WAIT_FOR_WINDOW=3;

$APP_EXEC &
sleep $TIME_WAIT_FOR_WINDOW;
env BAMF_DESKTOP_FILE_HINT="/var/lib/snapd/desktop/applications/termius-app_termius-app.desktop";
ID=$(xwininfo -name "$WIN_NAME"|grep xwininfo|cut -d ' ' -f 4);
xseticon -id $ID $APP_ICON;

If it doesn’t work, bash it! Full script: 🔨 ⛑️ 🐧

So it looks like all electron apps are suffering this bug due to variable name change in Ubuntu 17.04. Workaround isn’t the best way to launch all those apps. Seems that electron needs to update their framework, and app developers need to use the updated version. Any ETA on that? I’m kinda affected with this bug a lot, because i use a lot of electron build apps.