How can I change the Google Chrome webapp icon?

8,035

Solution 1

With daily chromium builds and recent BAMF you can (if you look closer to that screenshot, you can see an example with my site and high-res icon). But in the current state of chromium you need to do some hacking to make it support this easily:

  • Make chromium generate a .desktop file for the application Menu too (if you don't want you to create one by scratch).
  • Get your chromium app window WM_CLASS with xprop | grep WM_CLASS | awk '{print $4}' (if it's just "Chromium Browser" or something similar you need to update chromium).
  • Edit that .desktop file (located into ~/.local/share/applications) with gedit or any other text editor; the file should contain:

    StartupWMClass=$APP_WM_CLASS_Found_on_step_2
    Icon=~/your/icon/file/name/or/path
    

    i.e. (for an app pointing to http://mail.google.com with google_mail.png in ~/.local/share/icons):

    StartupWMClass=mail.google.com
    Icon=google_mail.png
    
  • Restart bamfdaemon or unity at all; now when you'll run an application with that WM_CLASS the settings defined in the desktop file you've just edited will be used; icon included ;)

Solution 2

Here is the easiest and fastest way.

Install Menu Editor:

sudo apt install menulibre

Open Menu Editor, Select App, Click on icon to select a new icon:

enter image description here

Solution 3

The easiest way for me was to install Alacarte (free from the Software Center) and edit the icon from there. It looks like an application to edit regular GNOME 2/GNOME Classic icons, but it works for Unity Launcher icons as well. The Chrome webapps are under "Chrome Applications", at least in my machine.

Share:
8,035

Related videos on Youtube

jrg
Author by

jrg

BY DAY: Software Developer at Upstart. BY NIGHT: I have an infrequently updated blog. FOR FUN: Camping, motorcycling, bicycling, geekin' out from time to time. In The Past: Ask Ubuntu Moderator email: james at armyofminions dot com

Updated on September 18, 2022

Comments

  • jrg
    jrg over 1 year

    So I've got the AskUbuntu chatroom (I'm just using this as an example, I've got other webapps that I've got the same issue with) saved as a "Application Shortcut" in Chromium, and the icon is really (And I mean really) low resolution. Example:

    enter image description here

    The top one is the default icon that's used for the Application Shortcut, the bottom is the AskUbuntu lens - so my question is, how can I use the icon that's used for the AskUbuntu lens.

    enter image description here

  • jrg
    jrg about 13 years
    Been trying with no luck. :l Using Chromium nightly, and also using a Up-to-date Unity install. :(
  • Treviño
    Treviño about 13 years
    @James Gifford: the currently bamfdemon package available in natty has not updated yet. You need to compile it from bzr to get this working.
  • Treviño
    Treviño about 13 years
    @James, now bamfdaemon package in natty should be updated. Give it a try again! ;)
  • Forty-Two
    Forty-Two about 8 years
    the xprop trick doesn't work. It just returns "google-chrome" . Update of course doesn't fix it.
  • Matt Pengelly
    Matt Pengelly over 4 years
    this was the easier way for me for sure. Thanks,
  • iGadget
    iGadget almost 4 years
    The method described above is complex and outdated. Consider installing menulibre instead, as indicated below by @Akashar Patel. Works like a charm.
  • iGadget
    iGadget almost 4 years
    Awesome tool, should come standard.