Bohemian Blog

  1. About This Blog
  2. Archives
  3. Blog
  4. Home

Replace Icons for Windows Applications on Linux via Wine

I recent pulled my old copy of Adobe Photoshop 7 for Windows out of mothballs and was delighted to discover that it now runs perfectly on Linux by the magical powers of Wine. I’ve been using the much more recent CS5 version on OSX at work, but Photoshop 7 has all of the features that I rely on except for layer groups. Which is not much of a problem, really.

The only problem was that the old 48-pixel icon that came with this version for Windows looked pretty hideous in my lovely new Gnome 3 Shell and Gnome Do menus. Customizing these icons means replacing whatever file the system is using for the default image. Conceptually, this is very straightforward. In reality, the location of these icon images is not always obvious. This post will explain how to replace icons for Windows applications running on Linux via Wine in as concise a manner as possible.

Find or Create New Icon Images

A quick search online gave me exactly what I was looking for: a 128-pixel PNG of the Photoshop 7 icon! It doesn’t always work out to be that easy. Or maybe you want to create your own, original icon. Whatever the case, you just need to create your icon as big as you need it or even a little larger, usually 128, 256, 512 or some other square dimensions that are divisible by 8.

Replace Default Icon Image File

Usually Linux systems will save icon image files somewhere around here:

/usr/share/pixmaps

or here:

/usr/share/icons/your_icon_themes_name/

but Wine saves these icons in a special place no doubt due to the “special” nature of running Windows applications on Linux:

/home/your_username/.local/share/icons/

In my specific case on Ubuntu 11.10 I found a folder titled “hicolor” in the “icons” folder. And inside of that I found the 48-pixel Photoshop 7 icon file in folders titled “48×48” and “apps”. So I created a new folder titled “128×128” as well as a folder titled “apps” inside of that.

And, finally, to correctly add a new icon image file navigate to that location and …

  1. Find the icon that you would like to replace.
  2. In another file browser window navigate to your new icon image file.
  3. Copy your new image file to … /icons/128×128/apps.
  4. Navigate back to … /icons/48×48/apps and copy the complete filename of the original image file.
  5. Return to …/icons/128×128/apps and update the filename of your new icon file by pasting in the copied filename.

In my case the filename was not as simple as “photoshop.png”. It had some arbitrary letters and numbers in it, so make sure the filename is the exact same otherwise it might not work.

Log out and log in to see if you are successful!

Update: July 7, 2013

So things have apparently changed for the worse regarding Wine applications and Gnome 3 Shell. Actually, it might be “better” and on the road to “great” but for now along with what you do above you also need to edit the .desktop file associated with your Windows application. Doing what I described above doesn’t inhibit Gnome from defaulting to the Wine Application Launcher icon.

The .desktop files are what tells your Linux system various details about a given application in order to list it in a system-wide application menu or even the contextual menu’s “Open With….” system. For Wine applications, these .desktop files are located here:

/home/your_username/.local/share/applications/wine/Programs

There is one small trick to these files: the Linux system (or at least Nautilus) sees these files as “application launchers”. As a result, right-clicking and opening with… mousepad or Gedit isn’t possible. You will have to start your text editor and then use its own open dialog to navigate to the location above and open your desired .desktop file from there.

Once you have the .desktop file open, we need to tell our Linux system to use a different icon than the one specified by default. So, open the file and look for the “Icon=” line. It will probably be associated with a long-ish filename that looks arbitrary and computer generated.

Simply replace that file name with the one used for your preferred icon files above and save the file. You might need to log in and log out to see the difference.