Solar and batteries (chemical). If we could harness lightening then that's come without mechanical energy as well. There's biological energy as well, we don't have a way to extract it directly as electricity but it exists
Mechanical and heat is just the most common way to get electricity for us at the moment.