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
  • 33,500
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
  • 5
  • 4
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
Falk
  • 333
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
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