but so were steam engines.
Fun fact: we still use steam engines in quite a lot of things, actually. Not so much with wood and coil furnaces to power boilers in locomotives, but just about every power plant uses a steam engine.
Yep, even nuclear reactors use some form of steam engine to generate electricity out of the heat they produce. It’s remarkably effective.
But of note to OP is that steam engines aren’t necessarily unsustainable. The heat to produce motion that generates electrical current can be generated by renewable means. Molten salt solar basically does that, for example, and it fits most definitions of “sustainable”.
What types of electric generation that aren’t heat related? I can think of wind and solar, and hydro? But nuclear and fossil fuels are steam, aren’t they?
You answered your own question - correct on all counts! 😊 There are really very few physical principles to base power generation technology off to begin with; it’s all going to come down to either inducing a current in a conductor by spinning a magnetic field (molten salt solar, nuclear, fossil fuels, hydro, wind, and anything else involving a turbine at any point all operate on this principle), or inducing a current by futzing with quantum mechanics (photovoltaic cells alone operate off this principle, as far as I understand such things - and I understand just enough to know I understand nothing at all).