Hello!
I’m trying to setup icons to kicad file types. At present, they show as follows, and I would appreciate
if the project file at least could have an easily identifyable icon. Anything would be fine. Here is how
a specific project folder looks like.
I’m using Ubuntu 20.10. Kicad 5.99.
I don’t know exactly what I’m doing, so I thought it might be better to ask… I read on the subject and i’ts apparently related to mime types.
I have checked file /usr/share/mime/packages, and there are 2 kicad-related files.
kicad-gerbers and kicad-kicad, both xml.
All other applications have a single name. (e.g, codeblocks.xml, not codeblocks-codeblocks.xml). Is this a bug?
In the kicad-kicad file, there is apparently nothing to set an icon, so I checked other websites, and found out that there is a file called mime.types in /etc. But again, this seems to be only for extensions. There is no kicad in the whole file, is it related to my problem? If I want to add kicad-related inpo, should it be something like application/kicad? Or application/vnd/kicad? Something else?
Any pointer would be nice.
You seem to already have the mapping from file suffix to mime type but you need to associate an SVG icon with that type.
Edit: I would also search to see if there are user defined locations for the mapping files because if you edit a system defined location they may be wiped out on upgrade.
Now I’m getting quite annoyed because that *&^%$#@ file manager can not even manage to show file names. For some *&^%$#@! reason it hides file extensions.
… And apparently it hides much more. what is this “org.kicad” prefix???
paul@medion:/usr/share/applications$ ls -hl *night*
lrwxrwxrwx 1 root root 72 May 17 10:36 org.kicad.bitmap2component-nightly.desktop -> ../kicad-nightly/applications/org.kicad.bitmap2component-nightly.desktop
lrwxrwxrwx 1 root root 64 May 17 10:36 org.kicad.eeschema-nightly.desktop -> ../kicad-nightly/applications/org.kicad.eeschema-nightly.desktop
lrwxrwxrwx 1 root root 64 May 17 10:36 org.kicad.gerbview-nightly.desktop -> ../kicad-nightly/applications/org.kicad.gerbview-nightly.desktop
lrwxrwxrwx 1 root root 61 May 17 10:36 org.kicad.kicad-nightly.desktop -> ../kicad-nightly/applications/org.kicad.kicad-nightly.desktop
lrwxrwxrwx 1 root root 69 May 17 10:36 org.kicad.pcbcalculator-nightly.desktop -> ../kicad-nightly/applications/org.kicad.pcbcalculator-nightly.desktop
lrwxrwxrwx 1 root root 62 May 17 10:36 org.kicad.pcbnew-nightly.desktop -> ../kicad-nightly/applications/org.kicad.pcbnew-nightly.desktop
paul@medion:/usr/share/applications$ cat org.kicad.kicad-nightly.desktop
[Desktop Entry]
Version=1.0
Terminal=false
Icon[fr]=kicad
Icon=kicad-nightly
Type=Application
Categories=Science;Electronics;
Exec=kicad-nightly %f
MimeType=application/x-kicad-project;
Name[de]=KiCad (nightly)
Name[el]=KiCad (nightly)
Name[en]=KiCad (nightly)
Name[es]=KiCad (nightly)
Name[fi]=KiCad (nightly)
Name[fr]=KiCad (nightly)
Name[it]=KiCad (nightly)
Name[ja]=KiCad (nightly)
Name[pl]=KiCad (nightly)
Name[ro]=KiCad (nightly)
Name[ru]=KiCad (nightly)
Name[sv]=KiCad (nightly)
Name[tr]=KiCad (nightly)
Name[zh_CN]=KiCad (nightly)
Name[zh_TW]=KiCad (nightly)
Name=KiCad (nightly)
GenericName[de]=EDA Suite (nightly)
GenericName[el]=Σουίτα EDA (nightly)
GenericName[en]=EDA Suite (nightly)
GenericName[es]=Suite EDA (nightly)
GenericName[fi]=EDA Suite (nightly)
GenericName[fr]=Suite CAO Electronique (nightly)
GenericName[it]=Suite EDA (nightly)
GenericName[ja]=EDAスイート (nightly)
GenericName[pl]=EDA Suite (nightly)
GenericName[ru]=САПР (nightly)
GenericName[tr]=EDA Paketi (nightly)
GenericName[zh_CN]=EDA 工具箱 (nightly)
GenericName[zh_TW]=EDA 工具箱 (nightly)
GenericName=EDA Suite (nightly)
Comment[en]=Suite of tools for schematic design and circuit board layout (nightly)
Comment[fr]=Suite d’outils pour la conception schématique et des circuits imprimés (nightly)
Comment=Suite of tools for schematic design and circuit board layout (nightly)
X-Desktop-File-Install-Version=0.22
But more importantly, I have not made those files myself. They were put there by KiCad’s installation procedure. Maybe you made an error during installation, or it may be some kind of bug.
A few weeks ago there was an error in the mimetype thing which caused all kicad-nightly entries to be removed from the start menu. That was reported and fixed within a few days.
KiCad does add the MIME types for its files when you install it on Linux - so I would suggest reporting this issue to the packager of KiCad on your distribution so that they can fix it in their setup.
Shouldn’t KiCAD add the mimetypes for its extensions when installing?
Yes it should. On the other hand, it’s not a crucial issue, it works without icons.
I’m looking at ways to do that right now. Basically what would help me is to have
icons for:
The project file
PCB file
Sch file
I read about mime types, etc, and I think that’s one way to do it, although slightly geeky.
Could anubody tell me the difference between the files with extensions .pro and .kicad_pro? Which one is the project file? Same question for extensions .sch and .kicad_sch. Apparently there is only one .kicad_pcb and no .pcb file. Is this normal?
Are there .svg files for the icons? Preferably the new Kicad6 icons.
You call it “slightly geeky”, but that’s how it is on Linux. Unfortunately you can’t just assign the file extension to an icon and associate it with an app to open with, like you would do on Windows.
First you must add a MIME type for your files, then you can associate an icon and app to that MIME type. The file extension has almost no significance to that process.
Unfortunately you can’t just assign the file extension to an icon and associate it with an app to open with, like you would do on Windows.
First you must add a MIME type for your files, then you can associate an icon and app to that MIME type. The file extension has almost no significance to that process.
But that’s not really what I was asking. In some project folder I’m looking at right now, there are files called filename.pro and filename.kicad_pro. In the meantime, I checked with a text editor, and the .kicad_pro seems to be a kind of preference file. But both start the program when double-clicked.
As for the .sch and .kicad_sch, is it a matter of old / new format?
Thanks for your reply. Anyway, I tried and it doesn’t work. I mean:
I have added new mime types because there was no kicad-related mimetype.
I have made svg icons that I copied to /usr/share/icons/gnome/scalable/mimetypes;
(I have created the mimetypes folder which was missing).
But the icons are still the same as above. I rebooted just to be sure.
But I can’t see the svg files on Ubuntu. I created them on mac, and it displays svg
nicely, but once copied on Ubuntu, there is only the icon name, not even a blank file
icon.
I think that will be about it for today, except if somebody has an idea to be tried.
And there is not even one hint at what the MIME-DIR could be. Any idea?
I thought it might be the place where mime.types is, which is /etc. But there is no
subfolder packages.
I assume you have installed KiCad somewhere, /usr/local/ or /opt/kicad/ or something like that. For me the 5.99 mime xml file is in /usr/local/share/mime. That’s probably the needed MIME-DIR.
Thanks for your reply. In my case, the s-kicad-schemtaic.xml looks exactly the same as what you show.
By the way, how do you display a piece of xml file? The first line is missing in the previes, whatever I do. So apparently it should treat sch and kicad_sch as schematic files.
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-kicad-schematic">
<!--Created automatically by update-mime-database. DO NOT EDIT!-->
<sub-class-of type="text/plain"/>
<comment>KiCad Schematic</comment>
<comment xml:lang="fr">Schéma électronique KiCad</comment>
<glob pattern="*.sch"/>
<glob pattern="*.kicad_sch"/>
</mime-type>
Beside this, if I check the porperties of a schematic file, it’s clearly defined as Type Kicsd Schematic (application/x-kicad-schematic).
So all you need to do is copy the files to /usr/share/icons/hicolor/SIZE/mimetypes
On my machine have
/usr/share/icons/hicolor/64x64/mimetypes/application-x-kicad-pcb.png
/usr/share/icons/hicolor/64x64/mimetypes/application-x-kicad-project.png
/usr/share/icons/hicolor/64x64/mimetypes/application-x-kicad-schematic.png
Make sure the SIZE (64x64 in the example above) matches the size you are using in your file manager. If you have svg files, you should use the scalable directory instead.
You might need to run gtk-update-icon-cache after adding the files.