extending mime-type def with generic-icon

Matthew Monaco dgbaley27 at verizon.net
Mon Oct 18 18:11:11 PDT 2010


On 10/18/2010 08:47 PM, Matthew Monaco wrote:
> On 10/18/2010 08:34 PM, Bastien Nocera wrote:
>> On Mon, 2010-10-18 at 19:21 -0400, Matthew Monaco wrote:
>>> On 10/18/2010 08:20 AM, Bastien Nocera wrote:
>> <snip>
>>> The thing is, I don't want the icons to be a part of a specific them. I renamed
>>> the icons to match the mimetype exactly, attempted both generic-icon and icon in
>>> both the system area and local user area, nothing has worked.
>>>
>>> I get that the image-x-generic in the gnome icon them would override something
>>> in hicolor, but the fact that I'm explicitly stating an icon AND naming that
>>> icon by the mimetype, yet I still don't see the correct icon, I don't get.
>>
>> You're supposed to install the named icons in hicolor, if you're
>> extending the basic set of icons. And don't forget to run
>> gtk-update-icon-cache.
>>
>> See how gnome-icon-theme-extras does it for example:
>> http://git.gnome.org/browse/gnome-icon-theme-extras
>>
>> In the future, reply to the list as well.
>>
>> Cheers
>>
>>
>
> I am installing the named icons in hicolor, and I am running gtk-update-icon cache.
>
> And sorry, I'm used to my "reply" button becoming "reply list" when on a mailing
> list... I guess it didn't because of the cc...

I should probably be a little more explicit:

========================================================================
/usr/share/mime/packages/xdg-matlab.xml
/usr/share/applications/matlab.desktop
/usr/share/icons/hicolor/48x48/apps/matlab.png
/usr/share/icons/hicolor/48x48/mimetypes/application-x-matlab-data.png
/usr/share/icons/hicolor/48x48/mimetypes/text-x-matlab.png
/usr/share/icons/hicolor/48x48/mimetypes/image-x-matlab-figure.png
/usr/share/icons/hicolor/16x16/apps/matlab.png
/usr/share/icons/hicolor/16x16/mimetypes/application-x-matlab-data.png
/usr/share/icons/hicolor/16x16/mimetypes/text-x-matlab.png
/usr/share/icons/hicolor/16x16/mimetypes/image-x-matlab-figure.png
/usr/share/icons/hicolor/256x256/apps/matlab.png
/usr/share/icons/hicolor/256x256/mimetypes/application-x-matlab-data.png
/usr/share/icons/hicolor/256x256/mimetypes/text-x-matlab.png
/usr/share/icons/hicolor/256x256/mimetypes/image-x-matlab-figure.png
/usr/share/icons/hicolor/32x32/apps/matlab.png
/usr/share/icons/hicolor/32x32/mimetypes/application-x-matlab-data.png
/usr/share/icons/hicolor/32x32/mimetypes/text-x-matlab.png
/usr/share/icons/hicolor/32x32/mimetypes/image-x-matlab-figure.png
========================================================================

with:

========================================================================
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
	
	<mime-type type="text/x-matlab">
		<comment>MATLAB script/function</comment>
		<sub-class-of type="text/plain"/>
		<magic priority="10">
			<match value="%" type="string" offset="0"/>
		</magic>
		<magic priority="50">
			<match value="function" type="string" offset="0"/>
		</magic>
		<glob pattern="*.m" weight="60"/>
		<alias type="text/x-octave"/>
		<icon name="text-x-matlab"/>
	</mime-type>
	
	<mime-type type="image/x-matlab-figure">
		<comment>MATLAB figure</comment>
		<magic priority="50">
			<match value="MATLAB" type="string" offset="0"/>
		</magic>
		<glob pattern="*.fig" weight="60"/>
		<icon name="image-x-matlab-figure"/>
	</mime-type>

	<mime-type type="application/x-matlab-data">
		<comment>MATLAB data file</comment>
		<magic priority="50">
			<match value="MATLAB" type="string" offset="0"/>
		</magic>
		<glob pattern="*.mat"/>
		<generic-icon name="application-x-matlab-mat"/>
	</mime-type>

</mime-info>
========================================================================

(remember, I've tried both 'generic-icon' _and_ 'icon'

followed by:
========================================================================
# gtk-update-icon-cache -f /usr/share/icons/hicolor
# update-mime-database /usr/share/mime
# update-desktop-database /usr/share/applications
========================================================================


More information about the xdg mailing list