Is there any way you could just have it automatically replace whatever ruler it generated for the largest city with the realm ruler and then have it label that city as the capitol?
Yes, that could work. I take a deeper look into this.