Fix double google chrome icon in docky and plank

  • Posted on: 27 May 2014
  • By: edwin

After the update to Chrome 35 and again with the update to 36 I discovered the launcher in docky and plank wasn't matching the chrome window correctly anymore. So it would show the launcher with a nice icon and then the actually launched app with a very low quality icon. Luckily, it's a simple fix... so let's get started. Open a terminal and type:

sudo gedit /usr/share/applications/google-chrome.desktop

You'll find 3 entries in this file, [Desktop Entry], [NewWindow Shortcut Group] and [NewIncognito Shortcut Group]. Make sure that under each group there's the following line, it doesn't matter where in the group it is.

StartupWMClass=Google-chrome-stable

For convenience, here is the modified chrome.desktop file for Ubuntu 14.04 Trusty Tahr. Just replace it with the one you have in /usr/share/applications/.

Now remove the chome launcher from docky or plank and stop docky or plank. If you're using docky, remove the docky cache folder ( ~/.cache/docky ) and start docky again.
If you're using plank, there's no need to remove the cache folder. When you pin the launcher again, it should match successfully.

To read more, please refer to this article on the docky wiki.

In case you keep having trouble, have a look in ~/.local/share/applications and remove google-chrome-stable.desktop from there if you find it.

 

Aother option is a script someone wrote and brought to my attention in the comments:
You can find it here: https://gist.github.com/Garont/46ce0d3a21471bc974fe

Comments

Thank you very much.

It was not that easy to find this post.

I think a lot of people have this issue with Chrome 35.

Bye and thank you again!

Thanks, this helped!

Thanks! Worked immediately after I saved the file!

Thanks for this easy solution. Why this isn't a thing in the Linux version of Chrome is beyond me. A lot of distros ship with Docky (PinguyOS) or Plank (Elemntary OS) and they are set to startup with the system. C'mon Google, really?

I switched to Firefox because of this, well, and also a bit slower than Firefox... but now I've got 8Gbs, so back to Chrome!!

Thank you very much, it was really helpful, perfect, worked like a charm with docky in Mint Quiana.

 

That works with Opera Developer too. Just use:

StartupWMClass=Google-chrome-stable

thx, you my hero, bro

Thank you so much! I had this problem for months. I found some workarounds but this is the first one that is easy and works that well!

Wrote small script for that.

sudo python <scriptname>

https://gist.github.com/Garont/46ce0d3a21471bc974fe

You are the man!!
 

Thank you so much. It's such a tiny problem, but it annoyed me a lot. Thanks again :)

Hi. Thank's for the tip. Any advice how to make chrome apps, like Wunderlist for ex, to display it's own icon and not the Chrome's?

Hi, actually I'm not sure, would love to know though...

I know this is old, but thank you. I loved Planky, but having two Chrome icons was incredibly irritating - enough so that I was considering just ditching it for something else because of how often I have a browser window open.

One thing though, shouldn't you use 'gksudo' for opening something like gedit? I'm new to Linux so I don't fully understand why, but that's what I've read/been told.

Hi Thanks for your comment, but as we're working from the terminal, sudo is fine.

Taken from the man of gksudo:

 "gksu  is a frontend to su and gksudo is a frontend to sudo.  Their
primary purpose is to run graphical commands that need  root  without 
the need to run an X terminal emulator and using su directly."

Thank you very much! Works in Xubuntu 14.10 with newest docky from official repo.

Thanks... simple, easy and effective :-)

Thanks!

Thank you very much. Works on "new" Ubuntu Mate 14.04

elegant, thank you.  i didn't need to reset plank, it was corrected upon file save in elementary os freya.  gksu is better than sudo for gui apps like gedit... just a thought.  with appreciation -uma

Here is another fix via terminal. Just execute this code "sudo sed 's/google-chrome-stable/google-chrome/g' /usr/share/applications/google-chrome.desktop > tmp; mv tmp /usr/share/applications/google-chrome.desktop". Disatvantage of this way: this must be done every time you're update google-chrome.

Thanks!

Thanks, helped a lot :D

Thanks for very useful guide. Without the added setting, i wasn't even getting the "pin to tab" selection on the right click menu in docky.

thank you!

Thanks buddy, really thanks. it's great, worked

Thanks. Didn't event have to restart plank, it fixed the icons after i saved chrome desktop file. This problem was really annoying and f**ing with elementary os experience :)

Dear Sir

Thanks!!! They should hang a photo of you in the Hall of Awesome.

 

Found another solution.

I just created a symlink "google-chrome-stable.desktop" in /usr/share/applications that point to "google-chrome.desktop".

The problem seems to be that plank or docky does search for "google-chrome-stable" instead of "google-chrome" .

Work immediatly without having to restart plank/docky.

Regards,

                BT

Thanks for sharing your solution!