Because I know that a simple API call handles setting the custom folder icons in Windows, I looked for an API method to set custom folder icons in Linux.
But in this thread, I saw that there is no such a way. Also I learnt that each desktop environment has its own way to set custom folder icons. The way of KDE is clearly described there.
For GNOME I looked for a similar way; but no file is created when setting the folder's icon from the properties panel. I think there should be a registry-like file in somewhere in the user home or /etc.
I will be glad, if you kill my pain. Thanks.