Easily Add Icons To DMenu

I am trying to make a DMenu with Icons for the main submenus like assmod does, had a look at the code and it seems to be remaking the dmenu it is a jumbled mess. Does anyone know of a simpler method, or has garry added a way to do it?