34

When I open Google Chrome on Ubuntu 14.04, it opens a new window on a different launcher icon (I have Chrome in my Launcher pinned) and the title of the window is a tab that I don't have open any more. I have uninstalled and reinstalled Google Chrome.

Tim
  • 32,861
  • 27
  • 118
  • 178
captainGeech
  • 923
  • 1
  • 6
  • 18

5 Answers5

42
rm $HOME/.local/share/applications/google-chrome-*.desktop

From then on, Unity launcher won't create a second icon when you open Chrome.

I suspect that file is created when Chrome navigates directly to a site upon launch. The google-chrome-*.desktop file gives Unity a different Name value for Google Chrome than that defined when the application was added to the launcher, so Unity launcher doesn't know it's the same application.

Chris
  • 536
  • 1
    For Trusty 14.04 amd64 my launcher icon displayed irrelevant rubbish, instead of "Google Chrome". I did exactly as above, only by using nautilus plus Ctrl-H to get to this file and Move to the Rubbish Bin. Then I restarted Chrome from the Ubuntu launcher button [HUD]. All good now, thanks Chris. – loser114491 May 11 '14 at 08:41
  • Worked perfectly for me with Ubuntu 14.10. – heinob Nov 26 '14 at 06:57
  • Worked for me too, however I will also note that I had to also untick the boxes "enable guest browsing" and "allow others to create profiles" and then close chrome, reopen and re-tick those boxes and close again. Afterwards the launcher icon worked properly again. – hazrpg May 14 '15 at 09:45
  • Worked like charm on Ubuntu 14.04 64 bit – Abhishek Aug 09 '15 at 16:35
  • 1
    It seems these are also created whenever you add an app shortcut (like Google Music, Inbox by Gmail, etc.) to your launcher. Deleting these .desktop files always deletes my app shortcuts from the launcher, which is its own problem. – msolters Sep 07 '15 at 01:20
  • worked on 15.10 too – Postadelmaga Nov 24 '15 at 05:04
12

This fix helped me out when the problem came back after each update.

edit /usr/share/applications/google-chrome.desktop

There are three entries in this file:
[Desktop Entry], [NewWindow Shortcut Group] and [NewIncognito Shortcut Group]

After each entry add this line:

StartupWMClass=Google-chrome-stable

Found this solution here:
http://kb.openstudioproject.com/content/fix-double-google-chrome-icon-docky-and-plank

And a bug report about it here:
https://code.google.com/p/chromium/issues/detail?id=378881#c13

bummi
  • 394
  • 3
  • 9
  • 14
Falk
  • 333
  • 2
  • 8
1

To explain things here, I came here because I WANTED my Chrome window to have a new icon.

Groupings of icons on the Launcher are controlled by the StartupWMClass= entry in the .desktop file in /opt/google/chrome/chrome https://jira.solium.com/ --class=boo --app=https://hipchat.solium.com/chat

You can edit the entry in the .desktop file to set the WM_CLASS that the icon will represent. You can edit the entry by adding --class myclassname to the chrome arguments, after all other arguments. So for me to launch a HipChat Chrome App, I used this:

[Desktop Entry]
Name=HipChat App
Comment=HipChat in Chrome App
Exec=/opt/google/chrome/chrome https://google.com/ --class=hipchat --app=https://hipchat.com/chat
Icon=/usr/share/icons/hicolor/1024x1024/apps/hipchat4.png
Terminal=false
Type=Application
Categories=Network,Chat
StartupWMClass=hipchat
turiyag
  • 111
  • My Google Chrome ignores the --class=hipchat part. After starting Chrome, I check its WM_CLASS using xprop and see that it is the default value Google-chrome. Any idea what is wrong here? – kostrykin Feb 03 '21 at 16:04
1

Here's what I found, Make sure you don't have a second google-chrome-stable.desktop file in your ~/.local/share/applications folder, for me that fixed the issue by doing:

sudo rm -rf google*.desktop in that folder, the only .desktop files you should have should reside in /usr/share/applications/. Hope this helps.

0

In the ~/.local/share/applications/google-chrome-stable.desktop, I replaced its Exec= line with that of the /usr/share/applications/google-chrome.desktop.

I had this line:

Exec=opt/google/chrome

and I replaced it with:

Exec=/usr/bin/google-chrome-stable %U