Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-10-23 08:12:49

Hocksul1
Member
Registered: 2022-10-23
Posts: 4

[Solved] Change icon for pdf files in Thunar

Hi,

I have tried to change the file type icon for my pdf files in Thunar, but to no avail.
I have followed the instructions given in this link , but it doesn't seem to work for me.

The article is however almost 11 years old, so it might be that the instructions don't work any more, and/or there might nowadays be an easier way to get the job done.

Any help is appreciated.

TIA

Last edited by Hocksul1 (2022-10-24 10:17:04)

Offline

#2 2022-10-23 12:29:57

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: [Solved] Change icon for pdf files in Thunar

Hello and welcome.

There should be an icon in your icon theme's mimes foider for PDF documents. You would just need to replace (or create if it doesn't exist) the file. To see which file it is, run the following command:

xdg-mime query filetype PDF-FILE

...where PDF_FILE is an actual pdf file on your system. It should return something like:

application/pdf

...which means it is the application-pdf.png or application-pdf.svg icons.

If you do change an icon, make sure you update the icon cache for it to take effect:

gtk-update-icon-cache

...and that it returns successfully.

Which distro, Xfce version, and icon theme are you using?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2022-10-23 16:09:08

Hocksul1
Member
Registered: 2022-10-23
Posts: 4

Re: [Solved] Change icon for pdf files in Thunar

Thank you very much for your prompt reply.

I ran

xdg-mime query filetype PDF-FILE 

and as you mentioned, it returned

application/pdf

I searched for application-pdf.png or application-pdf.svg icons, and it seems that there are many such icons in my system in many different folders.


To change the icon, I moved to /usr/share/mime/packages, opened freedesktop.org.xml with sudo, found the section under  <mime-type type="application/pdf"> and modified the line

<generic-icon name="x-office-document"/>

to

<generic-icon name="application-pdf.svg"/>

in that section of the file. I am however not sure if it was the proper way to change the icon.


Unfortunaely nothing changed, even after I ran

sudo update-mime-database $PWD
gtk-update-icon-cache

My distro is MX linux 21 (debian 11), Xfce version is 4.16.0,  and the icon theme is Papirus-mxbluedarkpanes.

Last edited by Hocksul1 (2022-10-23 17:56:10)

Offline

#4 2022-10-23 18:18:18

Hocksul1
Member
Registered: 2022-10-23
Posts: 4

Re: [Solved] Change icon for pdf files in Thunar

Update:

Based on a hint I got from another forum I tried to clean the application caches using stacer, and after that the pdf icons showed up.

So as you mentioned in your post, it seemed to do with the cache. But my excitement was short lived smile

A few minutes later I clicked on a different folder in Thunar, and when I got back to the original folder, I noticed that pdf icons do not show up agian.
Another strange thing is that python files seem to have different icons in different folders, so in Downloads folder the icons are like txt files, but in my "python" folder they have the typical python icon.

Last edited by Hocksul1 (2022-10-23 18:50:05)

Offline

#5 2022-10-23 20:51:22

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: [Solved] Change icon for pdf files in Thunar

Hocksul1 wrote:

I searched for application-pdf.png or application-pdf.svg icons, and it seems that there are many such icons in my system in many different folders.

These are the icons that you should change.

Does your pdf icon look like the application-pdf icon or the x-office-document icon? Or possibly another icon all together?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2022-10-24 10:16:24

Hocksul1
Member
Registered: 2022-10-23
Posts: 4

Re: [Solved] Change icon for pdf files in Thunar

My issue turned out to be related to Thunar settings, so display tab should be set to  'Show thumbnails' --> "Never".
Now the pdf-icon shows up, but on the downside, I have lost the thumbnail view for image files..

Thank you very much for your comments, much appreciated!

Last edited by Hocksul1 (2022-10-24 10:18:18)

Offline

#7 2022-10-24 15:09:38

chw9999
Member
Registered: 2022-01-07
Posts: 6

Re: [Solved] Change icon for pdf files in Thunar

Upgrading to Xubuntu 22.04.1 restored pdf thumbnail generation despite my preference set for generic pdf icons in  ~/.config/tumbler/tumbler.rc

I was able to switch if off again using the method described here (after "This WILL work"):
https://bugzilla.xfce.org/show_bug.cgi?id=16112

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.011 seconds, 8 queries executed - Memory usage: 543.14 KiB (Peak: 543.98 KiB) ]