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.

3
  • Which version of Chrome are you using? There are two different type of Chrome: A. Chrome .. or ... B. Chromium. Maybe you have both of version installed?
    – Faron
    Dec 27, 2013 at 17:49
  • I'm using version 31.0.1650.63 (Official Build 238485), and it's copyrighted by Google, so not Chromium. I don't have Chromium installed. Dec 27, 2013 at 18:28
  • possible duplicate of Chrome or Chromium icon doesn't show in the launcher Jul 25, 2014 at 19:05

5 Answers 5

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.

6
  • 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. May 11, 2014 at 8:41
  • Worked perfectly for me with Ubuntu 14.10.
    – heinob
    Nov 26, 2014 at 6: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, 2015 at 9:45
  • Worked like charm on Ubuntu 14.04 64 bit
    – Abhishek
    Aug 9, 2015 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 7, 2015 at 1:20
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

1
  • this with the rm of *.desktop from above fixed everything for me.
    – Alex R
    Aug 11, 2015 at 14:12
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.

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
1
  • 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 3, 2021 at 16:04
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .