I was looking around for a Jenkins Plugin that would allow me to customize the icon of a Folder as we use folders to separate projects at work. To my annoyance i only found a plugin that requires using Cloudbees own hosted Jenkins solution (Jenkins Folder Plugin Plus). The plugin Custom Job Icon Plugin does closely what i want to achieve but only works for plain jobs and ignores folders for some reason.
$JENKINS_HOME/userContent folder is reachable from
http://JENKINS_URL/userContent. jQuery is also included in the frontend of Jenkins so i was able to utilize that to check for existing icons in
/userContent/job-FOLDER_NAME.png with a HEAD ajax request.
/userContent and refer to it from the simple-theme plugin in the system configuration of Jenkins.
Here is the script: