Different nautilus thumbnails rendering for text files

Solution 1:

It seems for an icon theme to let Nautilus display the contents of plain text files as thumbnails, its sub-directory for mime types, which might be named, for example, mimes or mimetypes should have a file named text-x-preview.icon (along with an icon file named text-x-preview.png or text-x-preview.svg, etc. serving as a backdrop for the file contents thumbnail), which is actually a plain text file including settings for the thumbnail, in each sub-directory for different icon sizes (for example, 22, 24, 48).

For example, I have added ~/.local/share/icons/Nitrux/mimetypes/48/text-x-preview.icon (imported from the default Humanity icon theme) to my current icon theme, and only then it has begun displaying thumbnails for plain text files, which has the following content:

[Icon Data]
EmbeddedTextRectangle=180,100,680,900
AttachPoints=750,750|750,250|250,250|250,750

I'll hopefully try and add more information about the settings above in due course.

  • It seems having text-x-preview.icon and text-x-preview.svg (or another valid image file type) in the sub-directory for size 48px allows Nautilus to display thumbnails for all sizes from 48px upwards, but not for sizes below 48px, for which you also need text-x-preview.icon and text-x-preview.svg (or another valid image file type) at least in the sub-directories for sizes 22px and 24px (this lets Nautilus to display thumbnails also for 16px in some but not all icon themes).

These two files in the Humanity icon theme have exactly the same content:

[Icon Data]
EmbeddedTextRectangle=180,100,680,900

NOTE: Unfortunately this whole thing no longer works under Ubuntu 15.04