How to automatically assign a specific icon to all ".git" folders?

Hello. I’m running KDE plasma, and I wanted to know how would I go about setting a custom icon for all folder with the name “.git” so they would automatically use that icon.

I’m using Papirus Icons, which include a github folder (Can’t embedd images)

I tried copying the folder file association and applying it a different icon by setting a “.git” filename pattern, but it doesn’t change any existing folders I already have as they are all considered to be a “folder” file type.

Could you please help? I don’t know what else to do. I feel like I’m in the right direction but it’s like I’m missing a step to get there.

For custom icons in KDE Plasma you can set it manually, and it will create inside that folder a .directory file with a preview of that custom icon and inside it with a description like this:

[Desktop Entry]

To automatically populate all .git folders you maybe can use some touch and seed commands in combination with find (probably) but exclude some other files that have the .git in them. At this point there is no general folders rules like there is for files …

Personally i see no benefit in “decorating” the .git folders inside the project you host either on gitlab or github. A way for me to distinguish the two is to separate them locally in 2 main folders, and inside those folders have the projects.



Thank you so much for this answer. I will probably dwell deeper into auto creating a .directory file based on the name of the folder, maybe a daemon could work in this scenario.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.