Custom icons for certain file types with caja not showing, advice needed

I am trying to define custom icons (In this case for freecad files) to become visible in the file browser caja. Per default it displays the standard document icon for .fcstd files.

To get a more general solution, I wrote a script to do this. But whatever I try, .fcstd files just always appear with the standard document icon.

What the script does, is:
It downloads a tar.bz2 archive which contains a .desktop and .svg file. It then converts the svg file to different sizes of png files and installs them in the associated locations.

Then it installs the desktop file, adds a mimetype for .fcstd files, installs that as well.

The application icon for freecad appears correctly in plank, but in caja it does not. Whatever I try.

I do not know how to solve this.

The script can be found at github:

https://github.com/wmzart/system_scripts/blob/main/freecad_launcher.sh

I fixed it. The problem was that the script was using the wrong icon-theme. It should have been:

gsettings get org.mate.interface icon-theme

and not

gsettings get org.gnome.desktop.interface gtk-theme

After this change, the script worked. Icons are now correctly being shown.

The script is now also capable of uninstalling an desktop file, mimetypes and icon associated with it.

4 Likes