Ubuntu – How to change the icons of snap programs


I downloaded some themes and icons to customize my whole desktop UI and the last thing I need to change is some icons. I'm using a theme and it changed all the icons except for the programs that I either downloaded from the Ubuntu software store or using the snap command.

I went into the snap folder in the terminal and I saw a list of all the programs whose icons didn't change. I found the .desktop files for some of the programs, but when I use gedit and try to change the icon location, it says that it's read-only.

How can I change the permissions so that I can change the .desktop file? Is there an easier way to accomplish this?

See for example the Android Studio .desktop file contents:

Android Studio .desktop

Best Answer

  • You don't want to change the .desktop file installed by Snap. You cannot. Instead, override the .desktop file with your own custom version. Source thread on snapcraft.io.

    1. The snap's .desktop file is located at /var/lib/snapd/desktop/application/snap-name_application-name.desktop.

    2. Copy it to: ~/.local/share/applications/snap-name_application-name.desktop.

      • DON'T try to delete or edit the original.
      • The name schema (snap-name_application-name) is critical. Don't change it.

    Here's an example of creating an editable override copy (the discord application, provided by the discord snap):

    $ cp \
    > /var/lib/snapd/desktop/applications/discord_discord.desktop \
    > ~/.local/share/applications/discord_discord.desktop