7

I have Ubuntu 14.04 Gnome edition on both my laptop and the desktop; both are up-to-date but they have a different past-history of installations and upgrades.

Now, text-type thumbnails are different in the two machines, and I am unable to find where the difference is. This post: What rendering engine does Nautilus use to show HTML previews/thumbnails? seems obsolete (no entries in dconf for them), and Generate thumbnails for text? would help (but it's unanswered).

Look at this composed shot:

thumbnails for text

In the laptop the thumbnails have a small excerpt of the content of the file (the real content) while in my desktop they are simply blank.

I dug a bit around but I can't find which option/package is responsible of the laptop behavior (which I do prefer, by the way).

How can I enable the "text snapshot" in thumbnails? (And if they had syntax highlighting, like in the linked question, it would be great).

  • 1
    I see thumbnails for plain text files only when I choose icon themes ubuntu-mono-dark/light and Humanity/-Dark, but not when I use any other icon theme, which I find strange. Could this also be the case with your two different machines? – Sadi Feb 25 '15 at 16:02
  • @Sadi --- you are on the right track. So there is a thumbnailer override for themes? Do you know where I can find it and change it? My ultimate goal is having the ".tex" icons shown with the text preview and a small logo... – Rmano Feb 25 '15 at 16:20
  • Unfortunately I'm yet to find those answers as someone who doesn't know much about these matters. I've just asked two themers about this... – Sadi Feb 25 '15 at 16:28
  • I've begun experimenting with icon themes "Humanity" and "Nitrux" (my favorite); merging two by creating a copy of "Humanity", renaming it, coping all contents of "Nitrux" into this new one, inserting additional directories to the new index.theme file, etc. And now I have the old dark grey "Nitrux" icon for plain text files showing also the contents of each file! :-) – Sadi Feb 25 '15 at 17:24
  • 1
    @Sadi, please post it as an answer when you can! – Rmano Feb 25 '15 at 17:39
5

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

  • So it seems that is a sort of internal thing of gnome... would be nice to be able to tweak it (decide for example that text/x-tex mime type could have a different backdrop. Will wait, marking as solved for now. – Rmano Feb 25 '15 at 19:20
  • Is Nitrux an example, or will that value work for default Ubuntu? – Nicolas Raoul Feb 22 '16 at 3:51
  • 1
    @Nicolas Raoul yes Nitrux is just an example, it works in any theme, but only before Ubuntu 15.04 or equivalent Gnome version unfortunately. – Sadi Feb 22 '16 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.