I installed a new icon set (numix), however not all icons were changed (e.g. the software manager). How can I manually change icons?
Linux – Change icons of application in Linux Mint
iconslinux-mint
Related Solutions
First, desktop files aka "launchers" (should) comply to freedesktop specs. As to the icon, the above specification explains:
Icon to display in file manager, menus, etc. If the name is an absolute path, the given file will be used. If the name is not an absolute path, the algorithm described in the Icon Theme Specification will be used to locate the icon.
the algorithm being:
Icons and themes are looked for in a set of directories. By default, apps should look in $HOME/.icons (for backwards compatibility), in $XDG_DATA_DIRS/icons and in /usr/share/pixmaps (in that order).
........................................................................
The icon lookup mechanism has two global settings, the list of base directories and the internal name of the current theme. Given these we need to specify how to look up an icon file from the icon name and the nominal size.
The lookup is done first in the current theme, and then recursively in each of the current theme's parents, and finally in the default theme called "hicolor" (implementations may add more default themes before "hicolor", but "hicolor" must be last). As soon as there is an icon of any size that matches in a theme, the search is stopped. Even if there may be an icon with a size closer to the correct one in an inherited theme, we don't want to use it. Doing so may generate an inconsistant change in an icon when you change icon sizes (e.g. zoom in). The lookup inside a theme is done in three phases. First all the directories are scanned for an exact match, e.g. one where the allowed size of the icon files match what was looked up. Then all the directories are scanned for any icon that matches the name. If that fails we finally fall back on unthemed icons. If we fail to find any icon at all it is up to the application to pick a good fallback, as the correct choice depends on the context.
As per the above, on most modern desktops, icon themes location is $XDG_DATA_DIRS/icons
, that is /usr/share/icons
(global) and ~./local/share/icons
(user).
Second, changing an icon for a file type system-wide involves changing the mimetype icon coresponding to that file mime type, i.e. for .docx
files the mime type is
application/vnd.openxmlformats-officedocument.wordprocessingml.document
Gnome default icon set has no icon for that specific mime type so it falls back to x-office-document
(full path being /usr/share/icons/gnome/$SIZE/mimetypes/x-office-document
). Changing the icon for .docx
means you either have to come up with a new icon (of various sizes) named
application-vnd.openxmlformats-officedocument.wordprocessingml.document.png
or replace the x-office-document.png
that is used by default. Note the latter will change the icon for all files associated with x-office-document
mime type, not only .docx
.
It is not recommended to alter icon themes in /usr/share/icons
as your changes will most likely be overwritten by future updates so your best bet is to place your favorite icon theme in ~./local/share/icons
and add/modify whatever you want.
Finally, identifying the tray icons used by Gnome is not a trivial task, see this on AskUbuntu. Not sure if it applies to Gnome 3.6 since some shell parts are still under major rearchitecture and code changes every release.
The applet for the Battery Monitor plugin does not use a simple icon. It draws a 2D vector graphic using the Cairo library. You can only edit the panel item's appearance within the limits provided by the plugin, which does not currently include an option for replacing it with an icon.
It's normal that themes do not affect this panel item's appearance because, afaik, editing the package's source at lxpanel-<version>/plugins/batt/batt.c
and installing your new custom version is the only way to make dramatic changes beyond what the plugin's settings currently allow for. Alternatively, you would have to find a different battery monitor plugin or write your own if you want to see any major changes here.
Editing Battery Monitor's Appearance Settings:
Editing the file ~/config/lxpanel/LXDE/panels/panel.config
directly does not immediately update or refresh the appearance of the battery monitor panel item.
Instead, right-click the battery monitor applet and select "Battery Monitor" Settings
(where you'll notice it's actually two ugly green rectangles). The plugin should apply the new configuration and update the display of the widget upon closing this window.
Using a Different Plugin:
Some plugins, such as the GNOME Power Manager, can be themed by use of static icon images. From the officieal GNOME Power Manager project site:
The notification icon can display a device in the tray. The icons can be themed with custom icons for each theme, or fallback to a standard default.
This should allow you to use your theme's icons. Install it with apt-get.
apt-get install gnome-power-manager
You may or may not need to manually add @gnome-power-manager
to your /etc/xdg/lxsession/LXDE/autostart file. If you have any problems, please create a new question that pertains to Gnome Power Manager specifically.
Writing your own battery monitor plugin:
The details of writing your own plugin are beyond the scope of this question, but for those interested and willing to code a bit, see How to write plugins for LXPanel - LXDE.org and Debian - How to monitor battery capacity. As mentioned before, the battery monitor plugin included with the lxde-common package relies on the Cairo library. A good tutorial for working with that can be found at Cairo graphics tutorial.
The bounty requests: "Looking for an answer drawing from credible and/or official sources."
I am looking at the source for this plugin from lxpanel-0.7.1 downloaded at LXDE - Lightweight X Desktop Environment - Browse /LXPanel (desktop panel) at SourceForge.net
Best Answer
One way of finding the location of the icon for an application is to add it to the panel (right click > add to panel) and then right click on the newly added icon to edit it. By clicking on the icon in "Launcher Properties" you'll get its location. For instance
mintInstall
is found in/usr/lib/linuxmint/mintInstall/icon.svg
Having this you can then replace the icon with you own file and you can remove the application from the panel again.