This is just a quick bash script I wrote to generate Lakka playlists from my ROM directories. Only supports specific systems that I care about, but could easily be extended to support more. May need some customization depending on your core preferences.